当前位置:   article > 正文

SSH登陆无权限_/usr/bin/ssh-copy-id: info: 1 key(s) remain to be

/usr/bin/ssh-copy-id: info: 1 key(s) remain to be installed -- if you are pr

在第一版启动hadoop没有权限后,我开始了第二次尝试。这次我为区分各台虚拟机将用户名又初版的 wxy 改成了各自的主机名,结果在装ssh时出现了这个错误

复制代码
[master@master .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub master@slave2
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/master/.ssh/id_rsa.pub”
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
master@slave2’s password:
Permission denied, please try again.
master@slave2’s password:
Permission denied, please try again.
master@slave2’s password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
复制代码
一直提示 Permission denied, please try again. 尽管我密码正确。

[master@master .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub master@slave2

加粗的部分为slave2的用户名和主机名,应该为 slave2@slave2 ,再运行命令即可

复制代码
[master@master .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub slave2@slave2
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/master/.ssh/id_rsa.pub”
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
slave2@slave2’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘slave2@slave2’”
and check to make sure that only the key(s) you wanted were added.
复制代码
输入密码,成功执行。

注意 “ssh ‘slave2@slave2’” ,他会提示如何用ssh连接slave2,如果你直接 ssh slave2 还是会报错

复制代码
[master@master .ssh]$ ssh slave2
master@slave2’s password:
Permission denied, please try again.
master@slave2’s password:
Permission denied, please try again.
master@slave2’s password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
复制代码
而使用 ssh ‘slave2@slave2’ 则能正常免密登陆。

[master@master .ssh]$ ssh ‘slave2@slave2’
Last login: Wed Oct 20 04:27:04 2021
[slave2@slave2 ~]$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.18.132 netmask 255.255.255.0 broadcast 192.168.18.255
经查ip确定为slave2,问题解决!

如果问题解决了,如果你在装Hadoop,那么快跑!重建用户名,重新操作!

网上有不同用户名的登录教程,但是我看不懂,所以我选择直接重装…

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/187756
推荐阅读
相关标签
  

闽ICP备14008679号