Mac remote connection to cloud server

Source: Internet
Author: User
Tags ssh server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.