ssh免秘钥登录

Posted 开始认识

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ssh免秘钥登录相关的知识,希望对你有一定的参考价值。

SSH免秘钥登录

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责

[[email protected] ~]# ssh-keygen
Generating 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:
25:4b:57:51:1a:fc:c8:73:a8:6d:c9:a1:89:4a:29:90 [email protected]
The key‘s randomart image is:
+--[ RSA 2048]----+
| .+o. |
| ..o |
| . o o..+ |
| E . = * o |
| . .S. * = |
| . o . + = |
| o . . |
| . |
| |
+-----------------+

[[email protected] ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.115.81
[email protected]‘s password:
Now try logging into the machine, with "ssh ‘192.168.115.81‘", and check in:

.ssh/authorized_keys

to make sure we haven‘t added extra keys that you weren‘t expecting.

[[email protected] ~]# ssh 192.168.115.81
Last login: Sat Sep 30 07:33:13 2017 from 192.168.115.118
[[email protected] ~]# ifconfig

...

eth1 Link encap:Ethernet HWaddr 00:0C:29:33:36:3F 

inet addr:192.168.115.81 Bcast:192.168.115.255 Mask:255.255.255.0
...

以上是关于ssh免秘钥登录的主要内容,如果未能解决你的问题,请参考以下文章

centos7-ssh免秘钥登录

linux系统下ssh免秘钥登录

SSH配置免秘要登录

ssh目录权限说明

ssh免秘钥登陆实现

ssh免秘钥配置