updated ssh state
This commit is contained in:
parent
55720e0fd0
commit
475de43f3c
@ -1,4 +1,12 @@
|
||||
---
|
||||
ssh-ssh-config:
|
||||
file.managed:
|
||||
- name: /etc/ssh/ssh_config
|
||||
- source: salt://ssh/ssh_config.j2
|
||||
- template: jinja
|
||||
- user: root
|
||||
- mode: 0644
|
||||
|
||||
ssh-sshd-config:
|
||||
file.managed:
|
||||
- name: /etc/ssh/sshd_config
|
||||
|
@ -3,7 +3,8 @@ ssh:
|
||||
enabled: true
|
||||
pkgs:
|
||||
- 'openssh-server'
|
||||
config:
|
||||
- 'openssh-client'
|
||||
sshd_config:
|
||||
LoginGraceTime: 60
|
||||
PermitRootLogin: 'no'
|
||||
MaxAuthTries: 3
|
||||
@ -11,5 +12,7 @@ ssh:
|
||||
PasswordAuthentication: 'no'
|
||||
VersionAddendum: none
|
||||
Subsystem: sftp /usr/lib/openssh/sftp-server
|
||||
AllowGroups: root
|
||||
AllowGroups: admin
|
||||
X11Forwarding: 'yes'
|
||||
ssh_config:
|
||||
ForwardAgent: yes
|
||||
|
7
states/ssh/ssh_config.j2
Normal file
7
states/ssh/ssh_config.j2
Normal file
@ -0,0 +1,7 @@
|
||||
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
||||
|
||||
{%- from "ssh/map.jinja" import ssh with context %}
|
||||
|
||||
{%- for key, value in ssh.ssh_config.items() %}
|
||||
{{ key }} {{ value }}
|
||||
{%- endfor %}
|
@ -12,7 +12,7 @@
|
||||
{%- do net6.append( value.ip + "/" + value.mask ) -%}
|
||||
{%- endfor -%}
|
||||
|
||||
{%- for key, value in ssh.config.items() %}
|
||||
{%- for key, value in ssh.sshd_config.items() %}
|
||||
{{ key }} {{ value }}
|
||||
{%- endfor %}
|
||||
Match Address {{ net4|join(',') }}
|
||||
|
Loading…
Reference in New Issue
Block a user