Let's talk about the related situation first. When using putty to connect to Ubuntu, the system prompts: Connectionerror: Connectiontimedout, which means the connection times out !~ Later, I checked on the Internet and said that the ssh service was not started after the previously installed ssh protocol was restarted. Okay, start the ssh service servicesshdstart or/etc/init. d/sshstart to start.
Let's talk about the situation first.
When you use putty to connect to Ubuntu, the following error occurs: Connection error: Connection timed out.
The connection times out !~
Later, I checked on the Internet that the ssh service was not started after the previously installed ssh protocol was restarted,
Okay, start the ssh service sshd start or/etc/init. d/ssh start.
This prompt is found after startup
Cocould not load host key:/etc/ssh/ssh_host_rsa_key
Cocould not load host key:/etc/ssh/ssh_host_dsa_key
I don't understand this either. Maybe the two files do not exist.
Search for the files on the Internet and use the following command to recreate the files.
Enter ssh-keygen-t dsa-f/etc/ssh/ssh_host_dsa_key in the terminal to recreate the ssh_host_dsa_key file.
The following information is returned:
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase) :( press Enter)
Enter same passphrase again:
Your identification has been saved in/etc/ssh/ssh_host_dsa_key.
Your public key has been saved in/etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
Xx: xx root@localhost.localdomain
Enter ssh-keygen-t rsa-f/etc/ssh/ssh_host_rsa_key in the terminal to recreate the ssh_host_rsa_key file.
The following information is returned:
Generating public/private rkey pair.
Enter passphrase (empty for no passphrase) :( press Enter)
Enter same passphrase again:
Your identification has been saved in/etc/ssh/ssh_host_rsa_key.
Your public key has been saved in/etc/ssh/ssh_host_dsa_rey.pub.
Root@localhost.localdomain
Note: The preceding two commands do not work for common users. You must use the root permission.
By default, root is disabled. You can use the following command to enable the root account
Enter sudo passwd root (Press ENTER) under the terminal command line of a common user and enter the password twice for confirmation.
Finally, use the above method to start the ssh service.