资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

linux下怎么设置ssh免密码登录

这篇文章主要介绍“linux下怎么设置ssh免密码登录”,在日常操作中,相信很多人在linux下怎么设置ssh免密码登录问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”linux下怎么设置ssh免密码登录”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

网站建设哪家好,找创新互联公司!专注于网页设计、网站建设、微信开发、小程序制作、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了丰城免费建站欢迎大家使用!

##linux7设置ssh免密码登录(密码变更后一样可以登录)
[root@rhel7 ~]$ ssh-keygen          #生产密钥文件
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
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:
32:a8:b6:60:58:9e:c4:fe:eb:9d:69:d5:ff:3f:d1:3a root@rhel7
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
| .   .           |
|  + . o S.      .|
|.= o   o. .    ..|
|o.*    .   .   ..|
|.o o ..o    . E. |
|  ..+o+      ..oo|
+-----------------+

[root@rhel7 ~]$ ssh-copy-id 192.168.32.128                #复制到其他服务器
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.32.128's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.32.128'"
and check to make sure that only the key(s) you wanted were added. [root@rhel7 ~]$ ssh 192.168.32.128              #免密码登录
Last login: Mon Nov 20 22:30:47 2017 from 192.168.32.100
[root@MySQL ~]# exit
logout
Connection to 192.168.32.128 closed.

[root@mysql ~]# passwd
Changing password for user root.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

[root@rhel7 ~]$ ssh 192.168.32.128               #变更root密码后,还是可以免密码登录.
Last login: Mon Nov 20 22:32:35 2017 from 192.168.32.100                    

到此,关于“linux下怎么设置ssh免密码登录”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联网站,小编会继续努力为大家带来更多实用的文章!


文章题目:linux下怎么设置ssh免密码登录
URL地址:http://cdkjz.cn/article/jpgioo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220