summaryrefslogtreecommitdiff
path: root/services/applications/sshd.cf
blob: d44cbff09340bcee79d1d8e29b826c783fa67f14 (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
30
31
32
33
34
bundle agent sshd
{
    files:
        any::
            "/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"),
                copy_from => local_dcp("$(sys.inputdir)/templates/sshd/authorized_keys.cftpl"),
                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");
    services:
        linux::
            "sshd"
                service_policy => "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";
}