Linux 下 Hadoop 安装指南(2)

$ssh-keygen  -t rsa
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.

如果是root用户,则在
/root/.ssh/目录下生成一个私钥id_rsa和一个公钥id_rsa.pub。

2、将id_rsa.pub 文件 写入 authorized_keys 

cat id_rsa.pub >> ~/.ssh/authorized_keys  

查看 /root/.ssh目录

 3、装id_rsa.pub 文件发送到远程机器上

scp id_rsa.pub root@172.20.14.144:/home

cat /home/id_rsa.pub >> /root/.ssh/authorized_keys

这样ssh登录远程机器就不需要密码了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/92cd528f3a1457b12197086a38cbacfa.html