Hadoop GCE主VM ssh到从VM,然后显示权限被拒绝(公钥)
我试图构建Hadoop集群(一个主集群和一个从集群),所以我在GCE创建了两个实例 首先,我在主机上使用Hadoop GCE主VM ssh到从VM,然后显示权限被拒绝(公钥),hadoop,ssh,google-compute-engine,Hadoop,Ssh,Google Compute Engine,我试图构建Hadoop集群(一个主集群和一个从集群),所以我在GCE创建了两个实例 首先,我在主机上使用ssh-keygen命令: ssh-keygen -t rsa -P "" 然后我将~/.ssh/id\u rsa.pub复制到授权密钥 之后,我将~/.ssh/authorized_密钥从主机复制到从机的~/.ssh/ 当我开始在master上使用ssh slave-v时,出现了如下错误: hadoop_admin@master:~/.ssh$ ssh slave -v
ssh-keygen
命令:
ssh-keygen -t rsa -P ""
然后我将~/.ssh/id\u rsa.pub
复制到授权密钥
之后,我将~/.ssh/authorized_密钥
从主机复制到从机的~/.ssh/
当我开始在master上使用ssh slave-v
时,出现了如下错误:
hadoop_admin@master:~/.ssh$ ssh slave -v
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-cloudimg-settings.conf
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to slave [10.140.0.18] port 22.
debug1: Connection established.
debug1: identity file /home/hadoop_admin/.ssh/id_rsa type 0
debug1: identity file /home/hadoop_admin/.ssh/id_rsa-cert type -1
debug1: identity file /home/hadoop_admin/.ssh/id_dsa type -1
debug1: identity file /home/hadoop_admin/.ssh/id_dsa-cert type -1
debug1: identity file /home/hadoop_admin/.ssh/id_ecdsa type -1
debug1: identity file /home/hadoop_admin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/hadoop_admin/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/hadoop_admin/.ssh/id_ecdsa_sk-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to slave:22 as 'hadoop_admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit>
compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit>
compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-
nistp25SHA256:U2qV7NKQJ+yjlVnEBWOlLW3vITSpVoNx4haTFwHeHV0
debug1: Host 'slave' is known and matches the ECDSA host key.
debug1: Found key in /home/hadoop_admin/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: Permission denied
debug1: Will attempt key: /home/hadoop_admin/.ssh/id_rsa RSA
SHA256:RmmMCrG3VO0LWGjb2Em0kOT3Usmxzp
T5K3VmznglS74
hadoop_admin@master:~/.ssh$ssh slave-v
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2,OpenSSL 1.1.1f 2020年3月31日
debug1:读取配置数据/etc/ssh/ssh\u config
debug1:读取配置数据/etc/ssh/ssh_config.d/50-cloudimg-settings.conf
debug1:/etc/ssh/ssh\u配置第21行:应用*
debug1:连接到从[10.140.0.18]端口22。
debug1:已建立连接。
debug1:标识文件/home/hadoop\u admin/.ssh/id\u rsa类型0
debug1:identity file/home/hadoop\u admin/.ssh/id\u rsa-cert类型-1
debug1:identity file/home/hadoop\u admin/.ssh/id\u dsa type-1
debug1:identity file/home/hadoop_admin/.ssh/id_dsa-cert type-1
debug1:identity file/home/hadoop\u admin/.ssh/id\u ecdsa type-1
debug1:identity file/home/hadoop\u admin/.ssh/id\u ecdsa-cert type-1
debug1:identity file/home/hadoop\u admin/.ssh/id\u ecdsa\u sk type-1
debug1:identity file/home/hadoop\u admin/.ssh/id\u ecdsa\u sk-cert type-1
debug1:本地版本字符串SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1:远程协议版本2.0,远程软件版本OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1:match:OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH*compat 0x04000000
debug1:以“hadoop_admin”身份验证到从属服务器:22
debug1:SSH2\u MSG\u KEXINIT已发送
debug1:SSH2\u MSG\u KEXINIT已收到
debug1:kex:算法:curve25519-sha256
debug1:kex:主机密钥算法:ecdsa-sha2-nistp256
debug1:kex:server->client cipher:chachacha20-poly1305@openssh.com雨衣:
压缩:无
debug1:kex:client->server cipher:chachacha20-poly1305@openssh.com雨衣:
压缩:无
debug1:需要SSH2\u MSG\u KEX\u ECDH\u回复
debug1:服务器主机密钥:ecdsa-sha2-
nistp25SHA256:U2qV7NKQJ+YJLVNEBWOLLW3VITSPVONX4HATFWHV0
debug1:主机“从属”已知并与ECDSA主机密钥匹配。
debug1:在/home/hadoop\u admin/.ssh/known\u主机中找到密钥:1
debug1:在134217728块之后重新键入
debug1:SSH2\u MSG\u已发送新密钥
debug1:应为SSH2\u MSG\u NEWKEYS
debug1:SSH2\u MSG\u接收到新密钥
debug1:在134217728块之后重新输入
debug1:pubkey\u prepare:ssh\u get\u authentication\u套接字:权限被拒绝
debug1:将尝试密钥:/home/hadoop\u admin/.ssh/id\u rsa
SHA256:RmmMCrG3VO0LWGjb2Em0kOT3Usmxzp
T5K3VmznglS74
请检查您的
id\u rsa.pub
文件的权限-它应该是0600
。