Completely solve the problem of Ubuntu SSH being unable to log in remotely and SSH root login ACCESS Denied.
I installed Ubuntu 16.04 using a VM virtual machine and found two problems using SSH remote connection (different from Centos).
First, SSH cannot connect to the newly created virtual server.
The reason is that Ubuntu does not install the SSH service by default and needs to be installed manually.
-
sudo ps -e |grep ssh #Check whether the SSH service is installed (if it is empty, it is not installed)
-
sudo apt-get update #Update the resource list first
-
sudo apt-get install openssh-server #Install openssh-server
-
sudo ps -e |grep ssh #Check whether the installation is successful
-
sudo service sshd start #Restart the SSH service (or use the command sudo systemctl restart sshd)
Second, root login ACCESS Denied problem
After the first problem was solved, it was found that the following problems occurred when logging in as root through remote SSH connection:
The solution is as follows:
1. sudo vi /etc/ssh/sshd_config
Comment out PermitRootLogin prohibit-password
Add a line PermitRootLogin yes as shown below: