Skip to content

Commit

Permalink
Merge pull request #132 from hyrsky/master
Browse files Browse the repository at this point in the history
Added support for AuthorizedKeysFile config setting
  • Loading branch information
rndmh3ro authored Oct 17, 2017
2 parents a927903 + f321ec4 commit 936e997
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Warning: This role disables root-login on the target server! Please make sure yo
|`ssh_allow_users` | '' | if specified, login is allowed only for user names that match one of the patterns.|
|`ssh_deny_groups` | '' | if specified, login is disallowed for users whose primary group or supplementary group list matches one of the patterns.|
|`ssh_allow_groups` | '' | if specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns.|
|`ssh_authorized_keys_file` | '' | change default file that contains the public keys that can be used for user authentication.|
|`ssh_print_motd` | false | false to disable printing of the MOTD|
|`ssh_print_last_log` | false | false to disable display of last login information|
|`sftp_enabled` | false | true to enable sftp configuration|
Expand Down
1 change: 1 addition & 0 deletions default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ssh_allow_groups: 'root kitchen vagrant'
ssh_deny_users: 'foo bar'
ssh_deny_groups: 'foo bar'
ssh_authorized_keys_file: '/etc/ssh/authorized_keys/%u'
ssh_max_auth_retries: 10
ssh_permit_tunnel: true
ssh_print_motd: true
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ ssh_deny_groups: '' # sshd
# if specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns.
ssh_allow_groups: '' # sshd

# change default file that contains the public keys that can be used for user authentication.
ssh_authorized_keys_file: '' # sshd

# false to disable printing of the MOTD
ssh_print_motd: false # sshd

Expand Down
4 changes: 4 additions & 0 deletions templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ DenyGroups {{ssh_deny_groups}}
AllowGroups {{ssh_allow_groups}}
{% endif %}

{% if ssh_authorized_keys_file %}
AuthorizedKeysFile {{ ssh_authorized_keys_file }}
{% endif %}

# Network
# -------

Expand Down

0 comments on commit 936e997

Please sign in to comment.