• SSH登陆无权限


    在第一版启动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 mtu 1500
    inet 192.168.18.132 netmask 255.255.255.0 broadcast 192.168.18.255
    经查ip确定为slave2,问题解决!

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

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

  • 相关阅读:
    VMware虚拟机安装黑苹果步骤与常见问题,VMware16,MacOS12.01(Moterey)
    使用 compose 的 Canvas 自定义绘制实现 LCD 显示数字效果
    自定义MVC增删改查
    AIGC - stable-diffusion(文本生成图片) + PaddleHub/HuggingFace + stable-diffusion-webui
    在word文档中找不到endnote的选项卡
    K8S入门前奏之VMware虚拟机网络配置
    GO微服务实战第二十二节 案例:如何通过 Service Meh 实现熔断和限流?
    矩阵分析:特征值分解都在这里了
    求解哈夫曼树HuffmanTree以及C语言实现
    远程登录云上显卡(英伟达RTX5000)的主机,解决游戏应用帧率降低的问题
  • 原文地址:https://blog.csdn.net/weixin_43214644/article/details/126597429