您的位置:首页 > 博客中心 > 网络系统 >

Linux配置SSH免登录

时间:2022-04-03 11:42

[root@Linux01 ~]# ssh-keygen   #生成公私钥
[root@Linux01 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub hadoopuser@Hadoop-NN-01    #将公钥扔到对方服务器

-I 表示 input
~/.ssh/id_rsa.pub 表示哪个公钥组


省略写法为:

[root@Linux01 ~]# ssh-copy-id Hadoop-NN-01   #将公钥扔到对方服务器 或写IP:10.10.51.231
[root@Linux01 ~]# ssh-copy-id ”6000 Hadoop-NN-01”  #如果带端口则这样写

 

测试:

[root@Linux01 ~]# ssh Hadoop-NN-01  #验证(退出当前连接命令:exit、logout)
[root@Linux01 ~]# ssh Hadoop-NN-01 –p 6000  #如果带端口这样写 

 

热门排行

今日推荐

热门手游