Skip to content

Instantly share code, notes, and snippets.

@sumitsaiwal
Last active May 16, 2018 17:29
Show Gist options
  • Save sumitsaiwal/3dbc2fe058712a2a4b8e7c13184f472f to your computer and use it in GitHub Desktop.
Save sumitsaiwal/3dbc2fe058712a2a4b8e7c13184f472f to your computer and use it in GitHub Desktop.
sudo sed -i 's/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
sudo sed -i 's/PasswordAuthentication no/#PasswordAuthentication no/g' /etc/ssh/sshd_config
sudo sed -i '$ a PermitRootLogin yes' /etc/ssh/sshd_config
sudo sed -i '$ a PasswordAuthentication yes' /etc/ssh/sshd_config
sudo sed -i '$ a PermitRootLogin without-password' /etc/ssh/sshd_config
echo PASSWORD | sudu passwd
sudo service ssh restart (ubuntu)
sudo service sshd restart (rhel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment