记录linux的SSH免密登录

本文介绍了如何在Linux中实现SSH免密码登录,通过生成RSA密钥对,将公钥发送到远程主机,实现安全的无密码登录,提高工作效率。
摘要由CSDN通过智能技术生成

当我们从一台机器通过ssh登录到另外一台机器的时候,总是会要求输入登录密码,为了不输入密码登录,ssh提供了免密码登录,也就是所谓的公钥登录,公钥登录就是用户把自己的公钥发送到远程主机上,当远程主机需要登录的时候会做一个验签名的操作,如果签名通过那么就不需要密码登录啦。具体操作如下。

1、生成rsa的秘钥对

进入当前用户的根目录,执行ssh-keygen -t rsa,输入四个回车就行,不需要写啥..

[hadoop@hadoop ~]$ cd
[hadoop@hadoop ~]$ ssh-keygen  -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
48:28:73:09:f6:8a:03:d0:ab:37:2d:34:65:23:18:89 hadoop@hadoop.madmant.com
The key's randomart image is:
+--[ RSA 2048]----+
|+=o              |
|E.oo+o           |
|. o==..          |
|..+= . .         |
|oo.o  . S      
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值