summaryrefslogtreecommitdiff
path: root/services/applications/sshd.cf
blob: b3bfa3393870c593f9e2bb33cd76beac29a6e406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
bundle agent sshd
{
    files:
        freebsd::
            "/root/.ssh/."
                create => "true",
                perms => system_owned("700"),
                classes => if_repaired("sshd_ssh_dir_repaired");
            "/root/.ssh/authorized_keys"
                create => "true",
                edit_defaults => empty,
                perms => system_owned("444"),
                edit_template => "$(sys.inputdir)/templates/sshd/authorized_keys",
                classes => if_repaired("sshd_authorized_keys_files_repaired");
    classes:
        freebsd::
            "sshd_service_running" expression => returnszero("/usr/sbin/service sshd status", "noshell");
    methods:
        freebsd::
            "freebsd"  usebundle => add_rc_conf_line("$(this.bundle)", "sshd_enable=\"YES\"");
    commands:
        freebsd.!sshd_service_running::
            "/usr/sbin/service sshd start" classes => if_repaired("sshd_service_repaired");
    reports:
        any::
            "$(this.bundle): /root/.ssh directory repaired" ifvarclass => "sshd_ssh_dir_repaired";
            "$(this.bundle): /root/.ssh/authorized_keys repaired" ifvarclass => "sshd_authorized_keys_files_repaired";
            "$(this.bundle): sshd service repaired" ifvarclass => "sshd_service_repaired";
}