Mac Login to Raspberry Pi with SSH key

Source: Internet
Author: User

First, operate on the MAC.

Generate key
ssh-keygen -t rsa

The carriage return uses the default to be good.

add key to Ssh-agent
$ eval "$(ssh-agent -s)"

The PID is printed to indicate that the ssh-agent status is normal and proceed to the next step.

ssh-add ~/.ssh/id_rsa
Add a public key to the Raspberry Pi

Check the local key:

ls -al ~/.ssh

Copy the id_rsa.pub to pi, this copy process has a simple command (Ssh-copy-id), but, the default Mac is not, so we want to install this, you can refer to the online copy, directly download back, install. If you have brew installed, it's easy:

brew install ssh-copy-id

After installation, you can use Ssh-copy-id.

ssh-copy-id [email protected]

Here is my pi username and the IP address of pi.

After the completion, login pi try to see also need not lose password.

ssh [email protected]

Do not log in directly into the password, OK.

Mac Login to Raspberry Pi with SSH key

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.