CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
300 stars 189 forks source link

ssh_packet_disconnect_callback: Received SSH_MSG_DISCONNECT: 11:Bye Bye #1184

Closed rydy closed 2 years ago

rydy commented 2 years ago

Hi, version: netopeer2-server 2.0.35 libssh 0.9.5 I tried to use the CLI, and the following exception occurred.

root@OpenWrt:~# netopeer2-cli
> connect --host 0.0.0.0 --port 830 --ssh --login root
Interactive SSH Authentication
Type your password:
Password:
root@0.0.0.0 password:
nc ERROR: Unable to authenticate to the remote server (all attempts via supported authentication methods failed).
cmd_connect: Connecting to the 0.0.0.0:830 as user "root" failed.
>
root@OpenWrt:~# netopeer2-server -d -v 3
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: SR: Applying scheduled changes.
[INF]: LY: Searching for "ietf-datastores" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-datastores@2018-02-14.yang" file.
[INF]: LY: Searching for "ietf-yang-library" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-yang-library@2019-01-04.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "sysrepo-monitoring" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/sysrepo-monitoring@2021-07-29.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-datastores@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "sysrepo-plugind" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/sysrepo-plugind@2020-12-10.yang" file.
[INF]: LY: Searching for "ietf-netconf" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf@2013-09-29.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-netconf-acm" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-acm@2018-02-14.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-metadata" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-metadata@2016-08-05" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-netconf-with-defaults" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-with-defaults@2011-06-01.yang" file.
[INF]: LY: Searching for "ietf-yang-metadata" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-metadata@2016-08-05" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-netconf-notifications" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-notifications@2012-02-06.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-netconf@2013-09-29" is not used for import, revision "2013-09-29" is imported instead.
[INF]: LY: Searching for "ietf-origin" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-origin@2018-02-14.yang" file.
[INF]: LY: Searching for "ietf-yang-metadata" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-metadata@2016-08-05" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-netconf-monitoring" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-monitoring@2010-10-04.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-netconf-nmda" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-nmda@2019-01-07.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-datastores@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Implemented module "ietf-netconf@2013-09-29" is not used for import, revision "2013-09-29" is imported instead.
[INF]: LY: Searching for "nc-notifications" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/nc-notifications@2008-07-14.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "notifications" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/notifications@2008-07-14.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-x509-cert-to-name" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-x509-cert-to-name@2014-12-10.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-crypto-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-crypto-types@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-keystore" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-keystore@2019-07-02.yang" file.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-truststore" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-truststore@2019-07-02.yang" file.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Implemented module "ietf-crypto-types@2019-07-02" is not used for import, revision "2019-07-02" is imported instead.
[INF]: LY: Searching for "ietf-tcp-common" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-tcp-common@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-ssh-server" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-ssh-server@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-ssh-common" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-ssh-common@2019-07-02.yang" file.
[INF]: LY: Searching for "iana-crypt-hash" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/iana-crypt-hash@2014-08-06.yang" file.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-tls-server" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-tls-server@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-tls-common" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-tls-common@2019-07-02.yang" file.
[INF]: LY: Implemented module "ietf-keystore@2019-07-02" is not used for import, revision "2019-07-02" is imported instead.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-netconf-server" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-netconf-server@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-tcp-client" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-tcp-client@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-tcp-server" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-tcp-server@2019-07-02.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-tcp-common@2019-07-02" is not used for import, revision "2019-07-02" is imported instead.
[INF]: LY: Searching for "ietf-interfaces" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-interfaces@2018-02-20.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-ip" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-ip@2018-02-22.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-network-instance" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-network-instance@2019-01-21.yang" file.
[INF]: LY: Implemented module "ietf-interfaces@2018-02-20" is not used for import, revision "2018-02-20" is imported instead.
[INF]: LY: Searching for "ietf-yang-schema-mount" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-yang-schema-mount@2019-01-14.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-subscribed-notifications" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-subscribed-notifications@2019-09-09.yang" file.
[INF]: LY: Searching for "ietf-inet-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-interfaces@2018-02-20" is not used for import, revision "2018-02-20" is imported instead.
[INF]: LY: Implemented module "ietf-netconf-acm@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-restconf" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-restconf@2017-01-26.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-push" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-yang-push@2019-09-09.yang" file.
[INF]: LY: Searching for "ietf-yang-types" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
[INF]: LY: Implemented module "ietf-datastores@2018-02-14" is not used for import, revision "2018-02-14" is imported instead.
[INF]: LY: Searching for "ietf-restconf" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-restconf@2017-01-26.yang" file.
[INF]: LY: Newer revision than "ietf-restconf@2017-01-26" not found, using this as the latest revision.
[INF]: LY: Searching for "ietf-yang-patch" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-yang-patch@2017-02-22.yang" file.
[INF]: LY: Searching for "ietf-restconf" in "/tmp/sysrepo_repo/yang".
[INF]: LY: Loading schema from "/tmp/sysrepo_repo/yang/ietf-restconf@2017-01-26.yang" file.
[INF]: LY: Newer revision than "ietf-restconf@2017-01-26" not found, using this as the latest revision.
[INF]: LY: Use of anydata to define configuration data is not recommended. /ietf-yang-push:{augment='/sn:filters'}/ietf-yang-push:selection-filter/{uses='selection-filter-types'}/filter-spec/datastore-subtree-filter/datastore-subtree-filter
[INF]: LY: Use of anydata to define configuration data is not recommended. /ietf-subscribed-notifications:filters/stream-filter/{uses='stream-filter-elements'}/filter-spec/stream-subtree-filter/stream-subtree-filter
[INF]: LY: Use of anydata to define configuration data is not recommended. /ietf-yang-push:{augment='/sn:subscriptions/sn:subscription/sn:target'}/ietf-yang-push:datastore/{uses='datastore-criteria'}/{uses='selection-filter-objects'}/selection-filter/within-subscription/{uses='selection-filter-types'}/filter-spec/datastore-subtree-filter/datastore-subtree-filter
[INF]: LY: Use of anydata to define configuration data is not recommended. /ietf-subscribed-notifications:subscriptions/subscription/{uses='subscription-policy'}/{uses='subscription-policy-dynamic'}/{uses='subscription-policy-modifiable'}/target/stream/stream-filter/within-subscription/{uses='stream-filter-elements'}/filter-spec/stream-subtree-filter/stream-subtree-filter
[INF]: LY: Missing explicit "deprecated" status specified in parent "subnet", inheriting for "prefix-length".
[INF]: LY: Missing explicit "deprecated" status specified in parent "subnet", inheriting for "netmask".
[INF]: LY: The ordered-by statement is ignored in lists representing notification content (/ietf-yang-push:push-change-update/datastore-changes/{uses='ypatch:yang-patch'}/yang-patch/edit).
[INF]: SR: No scheduled changes.
[INF]: SR: Connection 96 created.
[INF]: SR: Session 57 (user "root", CID 96) created.
[INF]: SR: Triggering "ietf-subscribed-notifications" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[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-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[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:46950.
[INF]: SR: Session 77 (user "root", CID 96) created.
[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: Received an SSH message "request-auth" of subtype "interactive".
[INF]: LN: Failed user "root" authentication attempt (#1).
[INF]: LN: Received an SSH message "request-auth" of subtype "password".
[INF]: LN: Failed user "root" authentication attempt (#2).
[2015/08/02 11:54:18.834138, 1] ssh_packet_disconnect_callback:  Received SSH_MSG_DISCONNECT: 11:Bye Bye
[ERR]: LN: Communication SSH socket unexpectedly closed.
michalvasko commented 2 years ago

It is quite obvious from the output

[INF]: LN: Received an SSH message "request-auth" of subtype "interactive".
[INF]: LN: Failed user "root" authentication attempt (#1).
[INF]: LN: Received an SSH message "request-auth" of subtype "password".
[INF]: LN: Failed user "root" authentication attempt (#2).

that you have failed both authentication kinds, you have used an incorrect password for the user.

rydy commented 2 years ago

I've tried many times, and I'm sure I didn't get the password wrong, Libssh is incompatible with OpenSSL.

michalvasko commented 2 years ago

Not sure I understand, you were using some incompatible OpenSSL version? Because it is a necessary dependency of libssh.

rydy commented 2 years ago

Not sure I understand, you were using some incompatible OpenSSL version? Because it is a necessary dependency of libssh.

yes, By the way, Do you plan to support SSHV2 in the future?

michalvasko commented 2 years ago

I see, could you please mention the version? For other users that may encounter the same problem. Also, do you know what the incompatibility exactly was?

What do you mean by SSHv2? If you mean libssh2 then no because it includes only SSH client API, we need server as well.

rydy commented 2 years ago

I see, could you please mention the version? For other users that may encounter the same problem. Also, do you know what the incompatibility exactly was?

This is caused by a discrepancy between the openSSL I compiled and the openSSL I used at runtime.

What do you mean by SSHv2? If you mean libssh2 then no because it includes only SSH client API, we need server as well.

I made a mistake, libssh already supports SSHv2, I have one more question, Does libnetconf2 use SSHv1 by default? How do I use SSHv2?

michalvasko commented 2 years ago

This is caused by a discrepancy between the openSSL I compiled and the openSSL I used at runtime.

I see, probably not relevant for other user.

Does libnetconf2 use SSHv1 by default? How do I use SSHv2?

It is up to libssh, which I believe has SSHv1 disabled altogether by default for quite some time now. Why do you think you are not using SSHv2?

rydy commented 2 years ago

This is caused by a discrepancy between the openSSL I compiled and the openSSL I used at runtime.

I see, probably not relevant for other user.

Does libnetconf2 use SSHv1 by default? How do I use SSHv2?

It is up to libssh, which I believe has SSHv1 disabled altogether by default for quite some time now. Why do you think you are not using SSHv2?

I see(https://www.libssh.org/?s=sshv), Thanks.

rydy commented 2 years ago

version: libssh 0.9.5 openssh1.1.1j

What I just said was not correct, The first time I entered an empty password the connection succeeded, Repeated attempts to enter the correct password failed to connect. I've tried many times, and I'm sure I didn't get the password wrong.


root@OpenWrt:~# netopeer2-cli
> connect
Interactive SSH Authentication
Type your password:
Password:
> status
Current NETCONF session:
  ID          : 1
  Host        : 127.0.0.1
  Port        : 830
  Transport   : SSH
  Capabilities:
        urn:ietf:params:netconf:base:1.0
        urn:ietf:params:netconf:base:1.1
        urn:ietf:params:netconf:capability:writable-running:1.0
        urn:ietf:params:netconf:capability:candidate:1.0
        urn:ietf:params:netconf:capability:confirmed-commit:1.1
        urn:ietf:params:netconf:capability:rollback-on-error:1.0
        urn:ietf:params:netconf:capability:validate:1.1
        urn:ietf:params:netconf:capability:startup:1.0
        urn:ietf:params:netconf:capability:xpath:1.0
        urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,report-all-tagged,trim,explicit
        urn:ietf:params:netconf:capability:notification:1.0
        urn:ietf:params:netconf:capability:interleave:1.0
        urn:ietf:params:xml:ns:yang:ietf-yang-metadata?module=ietf-yang-metadata&revision=2016-08-05
        urn:ietf:params:xml:ns:yang:1?module=yang&revision=2021-04-07
        urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15
        urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2013-07-15
        urn:ietf:params:netconf:capability:yang-library:1.1?revision=2019-01-04&content-id=80
        urn:sysrepo:plugind?module=sysrepo-plugind&revision=2020-12-10
        urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2013-09-29&features=writable-running,candidate,confirmed-commit,rollback-on-error,validate,startup,url,xpath
        urn:ietf:params:xml:ns:yang:ietf-netconf-acm?module=ietf-netconf-acm&revision=2018-02-14
        urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?module=ietf-netconf-with-defaults&revision=2011-06-01
        urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&revision=2012-02-06
        urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04
        urn:ietf:params:xml:ns:netmod:notification?module=nc-notifications&revision=2008-07-14
        urn:ietf:params:xml:ns:netconf:notification:1.0?module=notifications&revision=2008-07-14
        urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name?module=ietf-x509-cert-to-name&revision=2014-12-10
        urn:ietf:params:xml:ns:yang:iana-crypt-hash?module=iana-crypt-hash&revision=2014-08-06
        urn:ietf:params:xml:ns:yang:iana-if-type?module=iana-if-type&revision=2017-01-19
> disconnect
> connect
Interactive SSH Authentication
Type your password:
Password:
root@localhost 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 "root" failed.
> exit
root@OpenWrt:~#
root@OpenWrt:~# tail -f /O-RAN/log/netopeer2-server.log
[INF]: SR: Triggering "ietf-netconf-server" "done" event on enabled data.
[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.
[WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 171.
[WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 171.
[WRN]: SR: Recovering module "ietf-netconf-acm" operational subscription of CID 171.

[INF]: LN: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:55310.
[INF]: SR: Session 61 (user "root", CID 178) created.
[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: Received an SSH message "request-auth" of subtype "interactive".
[WRN]: LN: User authentication successful with an empty password!
[INF]: LN: User "root" authenticated.
[INF]: LN: Received an SSH message "request-channel-open" of subtype "session".
[INF]: LN: Received an SSH message "request-channel" of subtype "subsystem".
[INF]: SR: Session 62 (user "root", CID 178) created.
[INF]: SR: There are no subscribers for "ietf-netconf-notifications" notifications.
[INF]: NP: Generated new event (netconf-session-start).
[INF]: LN: Session 1: Schema "ietf-netconf@2013-09-29" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-inet-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-netconf-acm@2018-02-14" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-metadata@2016-08-05" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-library@2019-01-04" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-inet-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-datastores@<any>" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-datastores@<any>" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-netconf-nmda@<any>" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-inet-types@2013-07-15" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-origin@<any>" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-metadata@2016-08-05" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-netconf-with-defaults@2011-06-01" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-metadata@2016-08-05" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: SR: Published event "rpc" "/ietf-netconf-nmda:get-data" with ID 1 priority 0 for 1 subscribers.
[INF]: SR: Processing "/ietf-netconf-nmda:get-data" "rpc" event with ID 1 priority 0 (remaining 1 subscribers).
[INF]: SR: Successful processing of "rpc" event with ID 1 priority 0 (remaining 0 subscribers).
[INF]: SR: Event "rpc" with ID 1 priority 0 succeeded.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "sysrepo@2021-09-07" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "sysrepo-monitoring@2021-07-29" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "sysrepo-plugind@2020-12-10" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-netconf-notifications@2012-02-06" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "nc-notifications@2008-07-14" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "notifications@2008-07-14" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-x509-cert-to-name@2014-12-10" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "ietf-crypto-types@2019-07-02" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "ietf-keystore@2019-07-02" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-truststore@2019-07-02" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "ietf-tcp-common@2019-07-02" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-ssh-server@2019-07-02" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-ssh-common@2019-07-02" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "iana-crypt-hash@2014-08-06" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "ietf-tls-server@2019-07-02" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-tls-common@2019-07-02" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "ietf-netconf-server@2019-07-02" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "ietf-tcp-client@2019-07-02" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-tcp-server@2019-07-02" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "ietf-interfaces@2018-02-20" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-ip@2018-02-22" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-network-instance@2019-01-21" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-schema-mount@2019-01-14" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-subscribed-notifications@2019-09-09" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "ietf-restconf@2017-01-26" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-push@2019-09-09" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "ietf-restconf@2017-01-26" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-yang-patch@2017-02-22" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "ietf-restconf@2017-01-26" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "ietf-dhcpv6-types@2018-09-04" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "iana-hardware@2018-03-13" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "ietf-hardware@2018-03-13" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "iana-if-type@2017-01-19" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-wg4-features@2020-12-10" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-dhcp@2020-12-10" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-supervision@2020-12-10" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-hardware@2020-12-10" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-interfaces@2020-12-10" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-file-management@2019-07-03" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-software-management@2019-07-03" was requested.
[INF]: NP: Session 1: thread 1 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-trace@2019-07-03" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-troubleshooting@2019-02-04" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-fm@2019-02-04" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-ald-port@2019-07-03" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-ald@2019-07-03" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-antenna-calibration@2020-12-10" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-sync@2020-08-10" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-compression-factors@2020-08-10" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-module-cap@2020-12-10" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-processing-element@2020-04-17" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-delay-management@2020-08-10" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-ecpri-delay@2019-02-04" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-ethernet-forwarding@2020-04-17" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-externalio@2019-07-03" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-fan@2019-07-03" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-laa@2019-07-03" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-laa-operations@2019-07-03" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-lbm@2019-02-04" was requested.
[INF]: NP: Session 1: thread 0 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-mplane-int@2019-07-03" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-performance-management@2020-12-10" was requested.
[INF]: NP: Session 1: thread 2 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-shared-cell@2020-12-10" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-transceiver@2019-07-03" was requested.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: LN: Session 1: Schema "o-ran-udp-echo@2019-02-04" was requested.
[INF]: NP: Session 1: thread 4 event new RPC.
[INF]: NP: Session 1: thread 3 event new RPC.
[INF]: NP: Session 1: thread 3 event session terminated.
[INF]: SR: There are no subscribers for "ietf-netconf-notifications" notifications.
[INF]: NP: Generated new event (netconf-session-end).
[2015/08/02 11:24:56.665383, 1] ssh_socket_exception_callback:  Socket exception callback: 1 (0)
[2015/08/02 11:24:56.665429, 1] ssh_socket_exception_callback:  Socket error: disconnected
[INF]: LN: Accepted a connection on 0.0.0.0:830 from 127.0.0.1:55312.
[INF]: SR: Session 70 (user "root", CID 178) created.
[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: Received an SSH message "request-auth" of subtype "interactive".
[INF]: LN: Failed user "root" authentication attempt (#1).
[INF]: LN: Received an SSH message "request-auth" of subtype "password".
[INF]: LN: Failed user "root" authentication attempt (#2).
[2015/08/02 11:25:05.729662, 1] ssh_packet_disconnect_callback:  Received SSH_MSG_DISCONNECT: 11:Bye Bye
[ERR]: LN: Communication SSH socket unexpectedly closed.
michalvasko commented 2 years ago

That is really strange and as expected, I could not reproduce it locally. It will be something specific to OpenWRT but I do not have access to that platform so I am not sure how I can help you. You could try experimenting with it more (login as another user with empty password, try to set password for root and try it then, ...) but best would be to look at what is ahppening in libnetconf2 during that authentication. You can do that with gdb or I could be able to provide patch with some messages that could show what the problem is.