Skip to content

Instantly share code, notes, and snippets.

@hyunbinseo
Created March 9, 2024 15:08
Show Gist options
  • Save hyunbinseo/8f1af453c8440d777d3987d56f2dd3ba to your computer and use it in GitHub Desktop.
Save hyunbinseo/8f1af453c8440d777d3987d56f2dd3ba to your computer and use it in GitHub Desktop.
Disable password authentication in Ubuntu 22.04 (Vultr instance)
cd /etc/ssh
sudo nano sshd_config
# PasswordAuthentication no
# Remove the leading pound sign
cd sshd_config.d
ls # 50-cloud-init.conf
sudo nano 50-cloud-init.conf
# PasswordAuthentication yes
sudo rm 50-cloud-init.conf
# passwordauthentication no
sudo sshd -T | grep passwordauthentication
sudo systemctl restart ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment