Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open ssh session with docker netopeer-server #127

Open
msandhu2014 opened this issue Aug 30, 2016 · 1 comment
Open

Unable to open ssh session with docker netopeer-server #127

msandhu2014 opened this issue Aug 30, 2016 · 1 comment

Comments

@msandhu2014
Copy link

msandhu2014 commented Aug 30, 2016

I am running docker netopeer-server on ubuntu 16.04. The server starts up fine and I can run the python script in .travis.yml to connect to it and get the config.
But I cannot establish an ssh session using command line ssh from unix prompt or from netopeer-cli.
Here is the log on the server when I try to connect using netopeer-cli.
I am using my userid from my unix system. It gives me a password prompt, which I don't expect, just
like in the python script. But I enter my password anyway and am denied authentication.

netopeer-server[1]: SSH log: ssh_server_curve25519_init: SSH_MSG_NEWKEYS sent
netopeer-server[1]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1]: SSH log: ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
netopeer-server[1]: SSH log: ssh_packet_process: Dispatching handler for packet type 21
netopeer-server[1]: SSH log: ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
netopeer-server[1]: SSH log: ssh_handle_key_exchange: ssh_handle_key_exchange: current state : 7
netopeer-server[1]: Received an SSH message "request-service" of subtype "ssh-userauth".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "none".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "password".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Failed user 'msandhu' authentication attempt (#1).
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Client session closed, removing it.

Following is the log when I try to ssh from the command line.
The command on the client side is

ssh 127.0.0.1 -p 8300 -s netconf -vvv
netopeer-server[1]: SSH log: ssh_packet_kexdh_init: Received SSH_MSG_KEXDH_INIT
netopeer-server[1]: SSH log: ssh_server_curve25519_init: SSH_MSG_KEX_ECDH_REPLY sent
netopeer-server[1]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1]: SSH log: packet_send2: packet: wrote [len=604,padding=8,comp=595,payload=595]
netopeer-server[1]: SSH log: packet_send2: packet: wrote [len=12,padding=10,comp=1,payload=1]
netopeer-server[1]: SSH log: ssh_server_curve25519_init: SSH_MSG_NEWKEYS sent
netopeer-server[1]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1]: SSH log: ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
netopeer-server[1]: SSH log: ssh_packet_process: Dispatching handler for packet type 21
netopeer-server[1]: SSH log: ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
netopeer-server[1]: SSH log: ssh_handle_key_exchange: ssh_handle_key_exchange: current state : 7
netopeer-server[1]: Received an SSH message "request-service" of subtype "ssh-userauth".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "none".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "publickey".
netopeer-server[1]: User 'msandhu' tried to use an unknown (unauthorized) public key.
netopeer-server[1]: Failed user 'msandhu' authentication attempt (#1).
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: Received an SSH message "request-auth" of subtype "interactive".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Received an SSH message "request-auth" of subtype "password".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Failed user 'msandhu' authentication attempt (#2).
netopeer-server[1]: Received an SSH message "request-auth" of subtype "password".
netopeer-server[1]: User 'msandhu' not found locally.
netopeer-server[1]: Failed user 'msandhu' authentication attempt (#3).
netopeer-server[1]: Reached the number of failed authentication attempts, dropping client 'msandhu'.

I see this line in the above log

netopeer-server[1]: User 'msandhu' tried to use an unknown (unauthorized) public key.

so I tried using this command line, but I get the same result.

ssh -i <path to my id_rsa> 127.0.0.1 -p 8300 -s netconf -vvv

When I run .travis.yml python script, I see

Received an SSH message "request-auth" of subtype "publickey".

and it passes authentication

@michalvasko
Copy link
Member

Hi,
the error that a user could not be found locally simply means that getpwnam() function failed. I believe there is nothing else the server can do in that case, it has no way of getting the password for comparison with the one the user entered.

As for SSH key authentication, the server needs to know which public keys are authorized and who do they belong to, which user (similar to SSH ~/.ssh/authorized_keys file). In netopeer, these options are part of the configuration, specifically /cfgnetopeer:netopeer/ssh/client-auth-keys/client-auth-key. So look into the model, it should be simple enough to understand, and add a list entry with the path to your key and your username. The easiest way of doing is using netopeer-configurator, which is a utility installed with netopeer-server.

Regards,
Michal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants