MAC SSH Key Login

Source: Internet
Author: User
Tags aliases mac ssh key

MAC SSH Key Login:

General Mac If you want to login through SSH key, the general practice, self-generated key pair, the advantage is that they only keep the private key, the public key can be placed any server, if you accept someone else to the private key, can only save one, if there are multiple private keys to you, it is not convenient to manage, so it is recommended that you generate Public key Upload Server, the following steps:

1. Through the Mac terminal, Ssh-keygen-t rsa-c "[email protected]" to generate a key pair, the public key is uploaded to the server corresponding to the user. Ssh/authorized_keys

2. Login to the server via SSH [email protected]

3. If you want to achieve fast landing, by means of aliases,

In the Mac. ssh/directory, create a new config file, vi to edit the file, with the following content:

Host mm58 #设置别名, such as Mm58

HostName 192.168.x.x #域名或ip

Port #默认端口, can be modified according to the actual situation

User SSL #登陆用户, such as SSL

Identityfile/users/haiwai02/.ssh/id_rsa #加载私钥存放位置

After saving the exit, you can log in directly by the following aliases,

SSH mm58 #即可实现密钥登陆

In addition, the general situation we need to login to more than one server, you can continue to add in the configuration file, the private key does not need to add, a common one can, as follows, we added a Foo account:

Host MM57

HostName x.x.x.x

Port 22

User Foo

Host mm58 #设置别名, such as Mm58

HostName 192.168.x.x #域名或ip

Port #默认端口, can be modified according to the actual situation

User SSL #登陆用户, such as SSL

Identityfile/users/haiwai02/.ssh/id_rsa #加载私钥存放位置


MAC SSH Key Login

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.