Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Ssh connection error

Shulou Source: shulou.com Published: 2022-06-01 07:16:34 10月03日 Update

Some strange errors may occur during ssh. Here is the parse:

1. Ssh does not allow root login

The following error is reported when connecting to ssh:

[root@SERVER] # ssh-p 10022 root@192.168.1.152

Root@192.168.1.152's password:

Permission denied, please try again.

Root@192.168.1.152's password:

Permission denied, please try again.

Root@192.168.1.152's password:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

The password entered is correct but cannot be connected.

This is because the destination host does not allow root login, which is a secure policy. You can modify the configuration on the destination host:

Vi / etc/ssh/sshd_config

Change PermitRootLogin no to PermitRootLogin yes

And then

/ etc/init.d/sshd restart

Just log in again.

2. Ssh does not authenticate password-based authentication

The error in the ssh connection is as follows:

[root@SERVER] # ssh-p 10022 root@192.168.1.152

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

No chance to enter a password.

Because password authentication is not allowed on the destination host, it is always secure, and only hosts with public keys are allowed to connect. Modify the destination host configuration:

Vi / etc/ssh/sshd_config

Change PasswordAuthentication no to PasswordAuthentication yes

/ etc/init.d/sshd restart

Just log in again.

3. Fingerprint information mismatch

This happens when you ssh:

[root@home] # ssh 192.168.1.3

@ @ @

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@ @ @

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

07:6c:c2:ce:82:d6:77:3c:b0:20:b0:e0:f2:2d:47:84.

Please contact your system administrator.

Add correct host key in / root/.ssh/known_hosts to get rid of this message.

Offending key in / root/.ssh/known_hosts:5

RSA host key for 192.168.1.3 has changed and you have requested strict checking.

Host key verification failed.

This is mainly caused by a fingerprint verification failure because the host was previously connected, but now the information has changed, resulting in a mismatch. The fingerprint information of the host can be obtained locally.

> / root/.ssh/known_hosts

Just connect again.

Tags: Host password time destination login information again fingerprint security situation error authentication input configuration authentication public key reason opportunity policy this is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno vpn Linux Shulou Technology