cfbs add promise-type-sshd
sshd promise typeConfigures sshd and restarts the service when configuration changes.
The sshd configuration keyword to manage (e.g. PermitRootLogin, AllowUsers).
Each promise manages a single directive in the drop-in config file.
value (required) — the value for the directive, either a string or an slistsshd_config includes the drop-in directory (sshd_config.d/) as its first non-comment directivesshd_config.d/00-cfengine.confsshd -T)Having multiple promises with the same sshd keyword is not recommended. In case of conflicting promisers, the agent will attempt to converge the correct state for each one in the order they are evaluated. This means the last promise wins and determines the final value in the configuration file. It will also cause multiple restarts of the sshd service, which may be disruptive.
packages: promiseservices: promisebundle agent sshd_config
{
packages:
"openssh-server" policy => "present";
services:
"sshd" service_policy => "start";
vars:
"allowed_users" slist => { "alice", "bob" };
sshd:
"PermitRootLogin" value => "no";
"PasswordAuthentication" value => "no";
"Port" value => "22";
"AllowUsers" value => @(allowed_users);
}
This software was created by the team at Northern.tech, with many contributions from the community. Thanks everyone!
Feel free to open pull requests to expand this documentation, add features, or fix problems. You can also pick up an existing task or file an issue in our bug tracker.
This software is licensed under the MIT License. See LICENSE in the root of the repository for the full license text.