CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
290 stars 186 forks source link

Unable to connect to netopeer2-server from netopeer2-cli #1545

Closed RostislavZalevsky closed 3 months ago

RostislavZalevsky commented 4 months ago

Hello,

I am trying to connect from netopeer2-cli to netopeer2-server.

[INF]: LN: User "user-1" partially authenticated, but still needs to authenticate via the rest of his configured methods.

Here's the detailed output from the terminal:

sudo netopeer2-server -v 2 -d

[INF]: SR: Connection 20 created.
[INF]: SR: Session 135 (user "root", CID 20) created.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: LN: Listening on 0.0.0.0:830 for SSH connections.
[INF]: SR: Triggering "ietf-keystore" "done" event on enabled data.
[INF]: SR: Triggering "ietf-truststore" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
[INF]: LN: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:33766.
[INF]: LN: Received an SSH message "request-service" of subtype "ssh-userauth".
[INF]: LN: Received an SSH message "request-auth" of subtype "none".
[INF]: LN: Received an SSH message "request-auth" of subtype "interactive".
**[INF]: LN: User "user-1" partially authenticated, but still needs to authenticate via the rest of his configured methods.**
[ERR]: LN: Communication SSH socket unexpectedly closed.
^C[INF]: NP: Server terminated.
netopeer2-cli -v3 -d

load_config: No saved configuration.
> connect
nc ERROR: Unable to connect to localhost:830 (Connection refused).
cmd_connect: Connecting to the localhost:830 as user "user-1" failed.
> connect
Keyboard-Interactive Authentication
Please enter your authentication token
user-1's password:
nc ERROR: Unable to authenticate to the remote server (all attempts via supported authentication methods failed).
cmd_connect: Connecting to the localhost:830 as user "user-1" failed.
> 

Can someone help me troubleshoot and resolve these issues?

Thank you

michalvasko commented 4 months ago

What netopeer2 version are you using? If at least the latest release, then you have configured several authentication methods for the user. It was changed (the YANG modules were) compared to previous versions that a user is authenticated when all of its methods succeed, not just one. Meaning every user should generally have only a single authentication method configured.

RostislavZalevsky commented 4 months ago

I am using the latest version. And still not able to connect. How to configure it ?

$ netopeer2-server -V
netopeer2-server 2.2.13

Thank you

michalvasko commented 4 months ago

Please post the output of sudo sysrepocfg -X -m ietf-netconf-server.