Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. echo "7. Configuring SSH"
  2. echo "Host *" >> /etc/ssh/ssh_config
  3. /usr/bin/awk '/^Protocol/ { $2 = "2"};
  4. /^X11Forwarding/ { $2 = "no"};
  5. /^#MaxAuthTries/ { $1 = "MaxAuthTries" ; $2 = "3"};
  6. /^#IgnoreRhosts/ { $1 = "IgnoreRhosts" ; $2 = "yes"};
  7. /^#RhostsRSAAuthentication/ { $1 = "RhostsRSAAuthentication" ; $2 = "no"};
  8. /^#LoginGraceTime/ { $1 = "LoginGraceTime" ; $2 = "0m"};
  9. /^#PermitRootLogin/ { $1 = "PermitRootLogin" ; $2 = "yes"};
  10. /^#PermitEmptyPasswords/ { $1 = "PermitEmptyPasswords" ; $2 = "no"};
  11. /^#Banner/ { $1 = "Banner" ; $2 = "yes"};
  12. {print}' /etc/ssh/sshd_config > /etc/ssh/sshd_config.new
  13.  
  14. cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
  15. /usr/bin/mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement