You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.
- name: Configure sshd and restart hosts: web user: bob become: yes roles:
- role: dev-sec.ssh-hardening ssh_port: 22ssh_use_pam: truesftp_enabled: truenetwork_ipv6_enable: false
Duplicates
sudo egrep -v '^(#|$)' /etc/ssh/sshd_config | sort | uniq -d
AllowAgentForwarding no
AllowTcpForwarding no
PasswordAuthentication no
PermitRootLogin no
X11Forwarding no
Workaround
As I intend to use sftp early in the process, I've commented the duplicate parameters outside of the if sftp_enabled block.
egrep '(AllowAgentForwarding|AllowTcpForwarding|PasswordAuthentication|PermitRootLogin|X11Forwarding)' templates/opensshd.conf.j2
#PermitRootLogin {{ 'without-password' if ssh_allow_root_with_key else 'no' }}
#PasswordAuthentication {{ 'yes' if ssh_server_password_login else 'no' }}
#AllowTcpForwarding {{ 'yes' if ssh_allow_tcp_forwarding else 'no' }}
#AllowAgentForwarding {{ 'yes' if ssh_allow_agent_forwarding else 'no' }}
#X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
PasswordAuthentication no
PermitRootLogin no
X11Forwarding no
This is gross but it does eliminate the duplicates:
The ansible run output with -v has been included: ansible-sshd.txt
As always, I reserve the right to be completely in the wrong :-)
Please let me know if I've duffed it.
The text was updated successfully, but these errors were encountered:
that's expected id sftp is enabled. The duplicate parameters here only match the group sftponly. They can differ from the default values so should be separate (and thus duplicate).
If sftp is disabled, there should be no duplicate parameters.
Your workaround is potentially insecure, because you disabled the secure parameters for every ssh-login. They are only activated for sftp logins.
Hey guys, I've just run this issue with a very basic configuration and found duplicates in
/etc/ssh/sshd_config
afterwards. The relevant details:The OS:
The configuration:
Duplicates
Workaround
As I intend to use sftp early in the process, I've commented the duplicate parameters outside of the
if sftp_enabled
block.This is gross but it does eliminate the duplicates:
The ansible run output with -v has been included: ansible-sshd.txt
As always, I reserve the right to be completely in the wrong :-)
Please let me know if I've duffed it.
The text was updated successfully, but these errors were encountered: