CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
296 stars 187 forks source link

Access denied for 'password' #1437

Open fei15115 opened 1 year ago

fei15115 commented 1 year ago

Hi , When I trying to use the passwd to connect the server ,got below error:

[2022/03/23 17:08:34.980945, 3] ssh_packet_process:  Dispatching handler for packet type 51
[2022/03/23 17:08:34.980992, 1] ssh_packet_userauth_failure:  Access denied for 'none'. Authentication that can continue: publickey,password
[2022/03/23 17:08:34.981042, 2] ssh_packet_userauth_failure:  Access denied for 'none'. Authentication that can continue: publickey,password
nc VERBOSE: Publickey athentication.
nc VERBOSE: No key pair specified.
nc WARNING: Authentication denied.
nc VERBOSE: Password authentication (host "localhost", user "san").
san@localhost password:
[2022/03/23 17:08:40.755445, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2022/03/23 17:08:40.755504, 3] packet_send2:  packet: wrote [type=50, len=56, padding_size=9, comp=46, payload=46]
[2022/03/23 17:08:40.755902, 3] ssh_packet_socket_callback:  packet: read type 51 [len=32,padding=7,comp=24,payload=24]
[2022/03/23 17:08:40.755941, 3] ssh_packet_process:  Dispatching handler for packet type 51
[2022/03/23 17:08:40.755971, 1] ssh_packet_userauth_failure:  Access denied for 'password'. Authentication that can continue: publickey,password
[2022/03/23 17:08:40.755997, 2] ssh_packet_userauth_failure:  Access denied for 'password'. Authentication that can continue: publickey,password
nc WARNING: Authentication denied.
nc ERROR: Unable to authenticate to the remote server (all attempts via supported authentication methods failed).
[2022/03/23 17:08:40.756105, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2022/03/23 17:08:40.756135, 3] packet_send2:  packet: wrote [type=1, len=32, padding_size=11, comp=20, payload=20]
cmd_connect: Connecting to the localhost:830 as user "san" failed.
>

I could make sure that the passwd is correct,But don't know why could not connect to the server. When I try to using the publickey to login the server and get success,But I want to login via the passwd. Could you help me with that?

release info : image

michalvasko commented 1 year ago

Run the server with -d -v2 parameters and you will see its output with the reason why it failed. Impossible to tell from the side of the client.

fei15115 commented 1 year ago

Hi, please check this out

[INF]: LN: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:34978.
Jul 11 10:23:57 M2-O daemon.info netopeer2-server[3347]: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:34978.
[INF]: SR: Session 31175 (user "root", CID 2) created.
Jul 11 10:23:57 M2-O daemon.info netopeer2-server[3347]: Session 31175 (user "root", CID 2) created.
[INF]: LN: Received an SSH message "request-service" of subtype "ssh-userauth".
Jul 11 10:23:57 M2-O daemon.info netopeer2-server[3347]: Received an SSH message "request-service" of subtype "ssh-userauth".
[INF]: LN: Received an SSH message "request-auth" of subtype "none".
Jul 11 10:23:57 M2-O daemon.info netopeer2-server[3347]: Received an SSH message "request-auth" of subtype "none".
[INF]: LN: Received an SSH message "request-auth" of subtype "password".
Jul 11 10:24:01 M2-O daemon.info netopeer2-server[3347]: Received an SSH message "request-auth" of subtype "password".
[INF]: LN: Failed user "root" authentication attempt (#1).
Jul 11 10:24:01 M2-O daemon.info netopeer2-server[3347]: Failed user "root" authentication attempt (#1).
[2023/07/11 10:24:01.562974, 1] ssh_packet_disconnect_callback:  Received SSH_MSG_DISCONNECT: 11:Bye Bye
[ERR]: LN: Communication SSH socket unexpectedly closed.
Jul 11 10:24:01 M2-O daemon.err netopeer2-server[3347]: Communication SSH socket unexpectedly closed.
michalvasko commented 1 year ago

So it seems you have simply failed the authentication. You have no SSH keys set for publickey authentication and have input the wrong password for password authentication. And it seems you have turned off keyboard-interactive authentication so there are no more methods for the client to try and it disconnects.

13065166838 commented 1 year ago

Hi, please check this out

企业微信截图_16891430504292

企业微信截图_16891433858885

michalvasko commented 1 year ago

That is all fine but the authentication information on the server is read from the system. Meaning only system users can be used and their system password must be presented. If using public keys, only those present in authorized_keys file of the user can be used for authentication.

13065166838 commented 1 year ago

We are using the system user, and logged into the system via ssh, which already exists before the connection.

michalvasko commented 1 year ago

Okay, then you must have used an incorrect password. Note that only local users are supported (we are working on some improvements), RADIUS will not work, for example.