Enabling Root for SSH on Ubuntu 20.04

Quick code sample to enable root on a fresh install – works for most distributions this was performed on a fresh install of Ubuntu 18.04 and 20.04.  The procedure is the same for Red Hat / Centos.  Perform the following from the initial account created during the system installation:

1
2
3
4
5
6
sudo passwd root
sudo passwd -u root
sudo ufw disable
sudo apt install -y openssh-server
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo service ssh restart
Lima

About the author

Lima is the visual nautical indicator for "stop instantly."

Leave a Reply