我无法通过网络连接到我的 Raspberry pi。密码正确。
[fixik@hub ~]$ ssh -v [email protected]
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /home/fixik/.ssh/config
debug1: /home/fixik/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 192.168.0.30 [192.168.0.30] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Raspbian-10+deb9u4
debug1: match: OpenSSH_7.4p1 Raspbian-10+deb9u4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.0.30:22 as 'pi'
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: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:nkw0sJMNMqv4Ps9o5QeDZq7N46LVTU3JW34IgoMeEZo
debug1: Host '192.168.0.30' is known and matches the ECDSA host key.
debug1: Found key in /home/fixik/.ssh/known_hosts:6
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/fixik/.ssh/id_rsa
debug1: Trying private key: /home/fixik/.ssh/id_dsa
debug1: Trying private key: /home/fixik/.ssh/id_ecdsa
debug1: Trying private key: /home/fixik/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password:
答案1
在我删除了known_hosts中192.168.0.30的行之后
[fixik@hub .ssh]$ pwd
/home/fixik/.ssh
[fixik@hub .ssh]$ ls
config known_hosts
[fixik@hub .ssh]$ cat known_hosts
192.168.0.58 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA
192.168.0.62 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA
**192.168.0.30 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA**
192.168.0.70 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA
192.168.0.74 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA
192.168.0.78 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHA
[fixik@hub .ssh]$
连接已可实现。成功连接的输出如下
[fixik@hub .ssh]$ ssh -v [email protected]
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /home/fixik/.ssh/config
debug1: /home/fixik/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to 192.168.0.30 [192.168.0.30] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/fixik/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4p1 Raspbian-10+deb9u4
debug1: match: OpenSSH_7.4p1 Raspbian-10+deb9u4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.0.30:22 as 'pi'
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: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:nkw0sJMNMqv4Ps9o5QeDZq7N46
The authenticity of host '192.168.0.30 (192.168.0.30)' can't be established.
ECDSA key fingerprint is SHA256:nkw0sJMNMqv4Ps9o5QeDZq7N46
ECDSA key fingerprint is MD5:30:8d:52:00:a0:93:2f:23:1f:a2:71:
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.30' (ECDSA) to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/fixik/.ssh/id_rsa
debug1: Trying private key: /home/fixik/.ssh/id_dsa
debug1: Trying private key: /home/fixik/.ssh/id_ecdsa
debug1: Trying private key: /home/fixik/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentication succeeded (password).
Authenticated to 192.168.0.30 ([192.168.0.30]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Linux fixik-15 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Apr 19 22:07:59 2023 from ::1
pi@fixik-15:~ $