We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibly you should update your code to first clean all duplicates: https://stackoverflow.com/questions/65228192/ansible-disable-ssh-password-authentication
Something like:
name: clean duplicates replace: path: '/etc/ssh/sshd_config' after: 'PasswordAuthentication' regexp: '^(.)PasswordAuthentication(.)$' replace: ''
name: clean duplicates replace: path: '/etc/ssh/sshd_config' after: 'PermitEmptyPasswords' regexp: '^(.)PermitEmptyPasswords(.)$' replace: ''
name: clean duplicates replace: path: '/etc/ssh/sshd_config' after: 'PermitRootLogin' regexp: '^(.)PermitRootLogin(.)$' replace: ''
name: set password login no lineinfile: path: '/etc/ssh/shd_config' regexp: '^(.)PasswordAuthentication(.)$' line: 'PasswordAuthentication no' notify: restart sshd
name: Disable empty password login lineinfile: path: '/etc/ssh/shd_config' regexp: '^(.)PermitEmptyPasswords(.)$' line: 'PermitEmptyPasswords no' notify: restart sshd
name: Disable remote root login lineinfile: path: '/etc/ssh/shd_config' regexp: '^(.)PermitRootLogin(.)$' line: 'PermitRootLogin no' notify: restart sshd
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Possibly you should update your code to first clean all duplicates:
https://stackoverflow.com/questions/65228192/ansible-disable-ssh-password-authentication
Something like:
name: clean duplicates
replace:
path: '/etc/ssh/sshd_config'
after: 'PasswordAuthentication'
regexp: '^(.)PasswordAuthentication(.)$'
replace: ''
name: clean duplicates
replace:
path: '/etc/ssh/sshd_config'
after: 'PermitEmptyPasswords'
regexp: '^(.)PermitEmptyPasswords(.)$'
replace: ''
name: clean duplicates
replace:
path: '/etc/ssh/sshd_config'
after: 'PermitRootLogin'
regexp: '^(.)PermitRootLogin(.)$'
replace: ''
name: set password login no
lineinfile:
path: '/etc/ssh/shd_config'
regexp: '^(.)PasswordAuthentication(.)$'
line: 'PasswordAuthentication no'
notify: restart sshd
name: Disable empty password login
lineinfile:
path: '/etc/ssh/shd_config'
regexp: '^(.)PermitEmptyPasswords(.)$'
line: 'PermitEmptyPasswords no'
notify: restart sshd
name: Disable remote root login
lineinfile:
path: '/etc/ssh/shd_config'
regexp: '^(.)PermitRootLogin(.)$'
line: 'PermitRootLogin no'
notify: restart sshd
The text was updated successfully, but these errors were encountered: