How to enable ssh root access ubuntu 16.04
on Ubuntu 16.04
ensure you have openssh-server server installed sudo apt-get install openssh-server
sudo nano /etc/ssh/sshd_config
change
PermitRootLogin prohibit-password
to
PermitRootLogin yes
or
sudo sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config
in order to PAM authentication add
AllowUsers root
or
sudo echo "AllowUsers root" >> /etc/ssh/sshd_config
sudo service ssh restart
works fine
in order you don't know your root password set new with privileged user
sudo passwd root
and you may want to get rid of password prompt in safe way what may be useful approach for sth like rsync, ansible and so on, so probably
from where ever you want to connect
ssh-keygen; ssh-copy-id -i ~/.ssh/id_rsa.pub root@YOURHOST
enter the root pass you have just set and DONE
ssh root@YOURHOST
Related videos on Youtube
bhytfghjmki
Updated on September 18, 2022Comments
-
bhytfghjmki over 1 year
on Ubuntu 16.04
sudo nano /etc/ssh/sshd_config
change
PermitRootLogin prohibit-password
to
PermitRootLogin yes
sudo service ssh restart
still permission denied
-
SDsolar about 6 years16.04 Mine does not have this line. Simply adding it and restarting the service still doesn't make it work.