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