Mac no secret login to Linux

Source: Internet
Author: User

Recently got a Linux cloud server, but every time landing Linux is good trouble, so daoteng the next SSH no secret landing.

Linux:centos 6.5, bring your own SSH

Mac:yosemite, bring your own SSH

Steps:

1. Create key

? .SSH Ssh-keygen-T rsagenerating Public/private RSA key pair. Enterfile inch whichTo save the key (/users/yinkw/.SSH/id_rsa): <--Direct Enter enter passphrase (empty forno passphrase): <--Direct Enter enter same passphrase Again:your identification has been saved inch/users/yinkw/.SSH/Id_rsa. Your public key has been savedinch/users/yinkw/.SSH/id_rsa.pub.The Key fingerprint is: -: -: the: This section of the middle is hidden.:d 1 [email protected]the key's Randomart image is:+--[RSA2048]----+|   ooooo=o+ | |     ... +o= + E | | .     *.+ .      || .        =.+      ||     S=.         ||                 . O | |                 ||                 || |+-----------------+? .SSHLltotal --RW-------1YINKW Staff1.6KTen  6  A: Oneid_rsa <--private key-rw-r--r--1YINKW Staff 399BTen  6  A: OneId_rsa.pub <--Public Key

2. Copy the public key to Linux

?  . SSH SCP id_rsa.pub [email protected]19.29.~~: ~/. SSH [email protected] 119.29. ~ ~ '  id_rsa.pub                                                                                     399     0. 4kb/s   :  XX

3. Linux, public key content appended to Authorized_keys

[Email protected]]~/. SSH  41 root root   0 September  :  authorized_ Keys1399 October  6:  Id_rsa.pub[[email Protected]]~/. SSH cat id_rsa.pub >> Authorized_keys

4. Mac Test

?  SSH [Email protected] 119.29. ~ ~ Login: Thu Oct                                                          6 : £101.106. ~ ~

Eh, what's going on, it's useless to restart the sshd service, but you can already use Rsakey to log in

5. Linux off passwd Login

/etc/ssh/sshd_config:

Permitemptypasswords No

I feel safer when I turn off the passwd landing.

--done--

Mac no secret login to Linux

Related Article

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.