Centos7下实现免密码登录

本文详细介绍了在CentOS7系统中如何实现SSH免密码登录,包括生成SSH密钥、设置权限以及多种实现免密登录的方法,如ssh-copy-id、scp和使用Ansible批量配置。
摘要由CSDN通过智能技术生成

一、生成密钥

[root@localhost soft]# 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:
SHA256:pvR6iWfppGPSFZlAqP35/6DEtGTvaMY64otThWoBTuk root@localhost.localdomain
The key's randomart image is:
+---[RSA 2048]----+
|  .  o.          |
|.o  . .          |
|+. o . . o       |
| Eo o . +        |
|   o o..S.       |
|  o ..oO.o       |
| . . ..=*oo      |
|  ..o *=@+ .     |
|  .oo=+@+.o..    |
+----[SHA256]-----+

生成之后会在用户的根目录生成一个 “.ssh”的文件夹,进入“.ssh”会生成以下几个文件

[root@localhost ~]# ls -a
.  ..  anaconda-ks.cfg  .ansible  .bash_history  .bash_logout  .bash_profile  .bashrc  .cache  .config
  • 4
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值