mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 14:16:52 +02:00
15 lines
835 B
Plaintext
15 lines
835 B
Plaintext
#!/bin/sh
|
|
|
|
sed -i -e '/^\(#\|\)PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)X11Forwarding/s/^.*$/X11Forwarding no/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)MaxAuthTries/s/^.*$/MaxAuthTries 2/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)AllowTcpForwarding/s/^.*$/AllowTcpForwarding no/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)AllowAgentForwarding/s/^.*$/AllowAgentForwarding no/' /etc/ssh/sshd_config
|
|
sed -i -e '/^\(#\|\)AuthorizedKeysFile/s/^.*$/AuthorizedKeysFile .ssh\/authorized_keys/' /etc/ssh/sshd_config
|
|
%{if manager_node ~}
|
|
sed -i '$a AllowUsers ${admin_user} terraform github' /etc/ssh/sshd_config
|
|
%{else ~}
|
|
sed -i '$a AllowUsers ${admin_user} terraform' /etc/ssh/sshd_config
|
|
%{endif ~}
|