Skip to content

Instantly share code, notes, and snippets.

@steebchen
Last active December 11, 2018 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steebchen/9006ffda3be17235f8f7059c20f5a5f0 to your computer and use it in GitHub Desktop.
Save steebchen/9006ffda3be17235f8f7059c20f5a5f0 to your computer and use it in GitHub Desktop.
sudo sed -i "s/#\{0,1\}Port .*/Port xxxx/" /etc/ssh/sshd_config
sudo sed -i "s/#\{0,1\}PermitRootLogin yes/PermitRootLogin no/" /etc/ssh/sshd_config
sudo sed -i "s/#\{0,1\}PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config
service sshd reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment