mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Add an important example for SSHd
Sudoers is a great example to show how you can prevent shutting yourself out. But SSHd is at least as important to avoid syntax errors causing a lot of grieve. So I think it deserves a spot in this list :-)
This commit is contained in:
@@ -101,4 +101,14 @@ EXAMPLES = '''
|
||||
src: /mine/sudoers
|
||||
dest: /etc/sudoers
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
# Update SSH configuration safely (avoid shutting yourself out)
|
||||
- template:
|
||||
src: etc/ssh/sshd_config.j2
|
||||
dest: /etc/ssh/sshd_config.j2
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
validate: /usr/sbin/sshd -t %s
|
||||
backup: yes
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user