ssh免密码登陆

来源:互联网 发布:中子星 知乎 编辑:程序博客网 时间:2024/06/06 00:46

A要免密码登陆B


在A上操作

生成密钥

ssh-keygen -t rsa  

一路回车就可以了

复制到B机器

sudo scp ~/.ssh/id_rsa.pub cuishizhou@172.16.160.94:/home/cuishizhou/hadoop/testfile


在B机器操作

cat /home/cuishizhou/hadoop/testfile/id_rsa.pub >>.ssh/authorized_keys
chmod 600 .ssh/authorized_keys


然后就可以在A机器上免密码登陆B了



原创粉丝点击