identity_sign: private key /root/.ssh/id_rsa contents do not match public
时间: 2023-11-29 13:05:25 浏览: 44
key /root/.ssh/id_rsa.pub contents. This error message typically occurs when the private and public keys do not belong to the same key pair. To resolve this issue, you can regenerate your SSH key pair and ensure that both the private and public keys are generated together. You can do this by running the following command in your terminal:
```
ssh-keygen -t rsa
```
This will generate a new SSH key pair and prompt you for a location to save the keys. Once you have saved the keys, make sure to update any servers or services that use your SSH key with the new public key.
相关问题
OpenSSH_9.2p1 Debian-2, OpenSSL 3.0.9 30 May 2023 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to lxslc702.ihep.ac.cn [2401:de00:2:332::186] port 22. debug1: Connection established. debug1: identity file /home/fyf/.ssh/id_rsa type -1 debug1: identity file /home/fyf/.ssh/id_rsa-cert type -1 debug1: identity file /home/fyf/.ssh/id_ecdsa type -1 debug1: identity file /home/fyf/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/fyf/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/fyf/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/fyf/.ssh/id_ed25519 type -1 debug1: identity file /home/fyf/.ssh/id_ed25519-cert type -1 debug1: identity file /home/fyf/.ssh/id_ed25519_sk type -1 debug1: identity file /home/fyf/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/fyf/.ssh/id_xmss type -1 debug1: identity file /home/fyf/.ssh/id_xmss-cert type -1 debug1: identity file /home/fyf/.ssh/id_dsa type -1 debug1: identity file /home/fyf/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_9.2p1 Debian-2 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4 debug1: compat_banner: match: OpenSSH_7.4 pat OpenSSH_7.4* compat 0x04000006 debug1: Authenticating to lxslc702.ihep.ac.cn:22 as 'fanyufan' debug1: load_hostkeys: fopen /home/fyf/.ssh/known_hosts: No such file or directory debug1: load_hostkeys: fopen /home/fyf/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 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 Connection closed by 2401:de00:2:332::186 port 22
根据您提供的信息,看起来您尝试使用SSH连接到主机lxslc702.ihep.ac.cn的端口22,但连接被远程服务器关闭了。关闭连接的原因可能有很多,例如网络问题、身份验证失败或服务器配置问题。要进一步诊断此问题,您可以尝试以下步骤:
1. 确保网络连接正常:检查您的网络连接是否正常,确保您可以访问远程服务器。
2. 检查身份验证凭证:确保您使用的身份验证凭证(例如用户名和密码、SSH密钥)是正确的,并且具有连接到远程服务器的权限。
3. 检查远程服务器配置:如果您有权限访问远程服务器的配置文件,请检查是否存在任何配置问题,例如防火墙设置、访问限制或SSH服务配置。
如果您仍然遇到问题,建议联系远程服务器的管理员或技术支持人员以获取更多帮助和支持。
INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" 是指要安装的密钥的来源路径,即/root/.ssh/id_rsa.pub文件的路径。 这个文件包含了公钥,用于在远程主机上进行身份验证。在执行ssh-copy-id命令时,它会将该公钥复制到远程主机的授权密钥文件中,以实现免密登录。