Linux SSH key Configuration login

Source: Internet
Author: User

Tag:ssh    generate    key   

#ssh-keygen -t rsagenerating public/private rsa key pair. enter file in which to save the key  (/ROOT/.SSH/ID_RSA):  Enter  passphrase  (empty for no passphrase): enter same passphrase  Again: your identification has been saved in /root/.ssh/id_rsa. your public key has been saved in /root/.ssh/id_rsa.pub.the key  Fingerprint is:2a:ad:45:20:74:8b:bf:8f:c4:a8:6e:af:46:50:6b:ea [email protected]the key ' s &NBSP;RANDOMART&NBSP;IMAGE&NBSP;IS:+--[&NBSP;RSA&NBSP;2048]----+|  . .             | | &NBSP, .... o .           | |  .o.o            | |.  oo .            | |. o  . . s        | |.  o + .         | | o . = +          | |  e . *           | | =oo.o .          |+-----------------+ #ssh-copy-id  -i ~/.ssh/id_rsa.pub 12.0.0.16[email protected] ' s password: now try logging  into the machine, with  "ssh  ' 12.0.0.16 '", and check in:   .ssh/authorized_keysto make sure we haven ' t added extra keys  That you weren ' t expecting. [ccdt-qh-Business navigation -1-root-<ccdt>]~ #ssh  12.0.0.16Last login: Sat Aug  5  10:27:32 2017 from 12.0.0.15[ccdt-qh-Business Navigation-2-root-<~>]~# 
#ssh-keygen-t RSA Three carriage return generate key Pair # # #生成rsa密钥对, saved by default in ~/.ssh/{id_rsa,id_rsa.pub}## #id_rsa私钥自己保存的 id_rsa.pub public Key saved by host # Ssh-copy-id-i ~/.ssh/id_rsa.pub 12.0.0.16## #将公钥copy到将要登录主机 (12.0.0.16), the default location, as defined in the SSH configuration file, is ~/.ssh/authorized_ The keys file does not require a password to sign in to perform SCP SSH completion:

The complete steps of the server configuration should be:

(1) Generate key public key to copy to server, private key is saved locally

(2) Configure Hosts.allow hosts.deny named ssh allow link Whitelist

(3) Prohibit login with password

(4) (optional) disable root user remote login


Go Go Go ...

This article comes from "insisting ... "Blog, be sure to keep this provenance http://qchanblog.blog.51cto.com/9686614/1953831

Linux SSH key Configuration 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.