Before the Mac command line to connect to the cloud server, has failed, today, the problem suddenly resolved, if you encounter similar problems, in accordance with the method can not be resolved, the following comments, discuss together.
First, in the cloud to determine whether the cloud server installed SSH server: openssh-server
At the command line, enter:
SSH localhost
If it has already been installed, the following results will appear
If it is not installed, the following result will appear:
Ssh:connect to host localhost Port 22:connection refused
Let's install the SSH server.
Write the following command at the terminal:
sudo apt-get install Openssh-server
It will be installed automatically.
Report:
Uninstall command sudo apt-get remove openssh-server
Start command sudo/etc/init.d/ssh start or service ssh start
View ssh status: Ps-e|grep ssh
If the display resembles the following, the installation is successful and is turned on
1418? 00:00:00 sshd
Then to the local connection to the remote server, I use a Mac, the other system should be similar
Open terminal, enter SSH [email protected] return
If it goes well, follow the prompts and enter the password.
If an SSH login fails: Host key verification failed this error (is related to the key), follow the prompts to find the file of the host key
For example:
My computer's files are in
known_hosts files under/users/pingguo/.ssh
Put the one that finds the IP of the host you want to connect to, delete it, and then save and exit
Next, use the above SSH command to try again, as long as the above prompts, the operation, (enter Yes, enter the password, and then return)
The connection should be successful.
Mac remote connection to cloud server