Browse Source

Put ssh keys on configured path in sshd_config (AuthorizedKeysFile)

Signed-off-by: POTIER Mathieu <mathieu.potier@onzeway.eu>
master
POTIER Mathieu 9 years ago
parent
commit
dda1fb5128
2 changed files with 7 additions and 1 deletions
  1. +3
    -1
      openssh/auth.sls
  2. +4
    -0
      pillar.example

+ 3
- 1
openssh/auth.sls View File

{{ print_name(identifier, key) }}: {{ print_name(identifier, key) }}:
ssh_auth.present: ssh_auth.present:
{{ print_ssh_auth(identifier, key) }} {{ print_ssh_auth(identifier, key) }}
- config: {{ pillar['sshd_config']['AuthorizedKeysFile'] }}
- require: - require:
- service: {{ openssh.service }} - service: {{ openssh.service }}
{%- else %} {%- else %}
{{ print_name(identifier, key) }}: {{ print_name(identifier, key) }}:
ssh_auth.absent: ssh_auth.absent:
{{ print_ssh_auth(identifier, key) }} {{ print_ssh_auth(identifier, key) }}
- config: {{ pillar['sshd_config']['AuthorizedKeysFile'] }}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{%- endfor -%}
{%- endfor -%}

+ 4
- 0
pillar.example View File

PermitEmptyPasswords: 'no' PermitEmptyPasswords: 'no'
ChallengeResponseAuthentication: 'no' ChallengeResponseAuthentication: 'no'
AuthenticationMethods: 'publickey,keyboard-interactive' AuthenticationMethods: 'publickey,keyboard-interactive'
AuthorizedKeysFile: '%h/.ssh/authorized_keys'
X11Forwarding: 'yes' X11Forwarding: 'yes'
X11DisplayOffset: 10 X11DisplayOffset: 10
PrintMotd: 'no' PrintMotd: 'no'
present: True present: True
enc: ssh-rsa enc: ssh-rsa
comment: main key - desktop comment: main key - desktop
source: salt://ssh_keys/joe.desktop.pub
joe-valid-ssh-key-notebook: joe-valid-ssh-key-notebook:
- user: joe - user: joe
present: True present: True
enc: ssh-rsa enc: ssh-rsa
comment: main key - notebook comment: main key - notebook
source: salt://ssh_keys/joe.netbook.pub
joe-non-valid-ssh-key: joe-non-valid-ssh-key:
- user: joe - user: joe
present: False present: False
enc: ssh-rsa enc: ssh-rsa
comment: obsolete key - removed comment: obsolete key - removed
source: salt://ssh_keys/joe.no-valid.pub


generate_dsa_keys: False generate_dsa_keys: False
absent_dsa_keys: False absent_dsa_keys: False

Loading…
Cancel
Save