Can't ssh into VMs

Hello

I’m getting a password request when trying to log into a LXC VM. I can log into it’s host without a password request

ssh -vvv 3.68.252.84 (password request, as oneadmin)

OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /var/lib/one/.ssh/config
debug1: /var/lib/one/.ssh/config line 9: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Control socket “/run/one/ssh-socks/ctl-M-f8beb43c5c60489e3ccd08074448e46e784e4c55.sock” does not exist
debug2: resolving “3.68.252.84” port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 3.68.252.84 [3.68.252.84] port 22.
debug1: Connection established.
debug1: identity file /var/lib/one/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 3.68.252.84:22 as ‘oneadmin’
debug3: hostkeys_foreach: reading file “/var/lib/one/.ssh/known_hosts”
debug3: record_hostkey: found key type ECDSA in file /var/lib/one/.ssh/known_hosts:123
debug3: load_hostkeys: loaded 1 keys from 3.68.252.84
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:6xxM9qNHnaGawVnGfeWCNxCoNoeHTkXPGakBgyUUYjs
debug3: hostkeys_foreach: reading file “/var/lib/one/.ssh/known_hosts”
debug3: record_hostkey: found key type ECDSA in file /var/lib/one/.ssh/known_hosts:123
debug3: load_hostkeys: loaded 1 keys from 3.68.252.84
debug1: Host ‘3.68.252.84’ is known and matches the ECDSA host key.
debug1: Found key in /var/lib/one/.ssh/known_hosts:123
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /var/lib/one/.ssh/id_rsa (0x557cf482e030)
debug2: key: /var/lib/one/.ssh/id_dsa ((nil))
debug2: key: /var/lib/one/.ssh/id_ecdsa ((nil))
debug2: key: /var/lib/one/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:l5qDtqrxhoUcmKqm+S1GR8AnqYu91WVxg5W1qOUoxn0 /var/lib/one/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /var/lib/one/.ssh/id_dsa
debug3: no such identity: /var/lib/one/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /var/lib/one/.ssh/id_ecdsa
debug3: no such identity: /var/lib/one/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /var/lib/one/.ssh/id_ed25519
debug3: no such identity: /var/lib/one/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

ssh -vvv 54.93.244.53 (succesful without password, as oneadmin)

OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /var/lib/one/.ssh/config
debug1: /var/lib/one/.ssh/config line 9: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Control socket “/run/one/ssh-socks/ctl-M-b17aa95248261cfda171a3925deeda298428dff1.sock” does not exist
debug2: resolving “54.93.244.53” port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 54.93.244.53 [54.93.244.53] port 22.
debug1: Connection established.
debug1: identity file /var/lib/one/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/lib/one/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 54.93.244.53:22 as ‘oneadmin’
debug3: hostkeys_foreach: reading file “/var/lib/one/.ssh/known_hosts”
debug3: record_hostkey: found key type RSA in file /var/lib/one/.ssh/known_hosts:117
debug3: record_hostkey: found key type ECDSA in file /var/lib/one/.ssh/known_hosts:119
debug3: record_hostkey: found key type ED25519 in file /var/lib/one/.ssh/known_hosts:120
debug3: load_hostkeys: loaded 3 keys from 54.93.244.53
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: ciphers stoc: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc
debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha1,umac-128@openssh.com,hmac-sha2-512
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:rqsKSJGh8Mr/cbZLdN27HNAZu4N6y3mlf/rT1Tas0P0
debug3: hostkeys_foreach: reading file “/var/lib/one/.ssh/known_hosts”
debug3: record_hostkey: found key type RSA in file /var/lib/one/.ssh/known_hosts:117
debug3: record_hostkey: found key type ECDSA in file /var/lib/one/.ssh/known_hosts:119
debug3: record_hostkey: found key type ED25519 in file /var/lib/one/.ssh/known_hosts:120
debug3: load_hostkeys: loaded 3 keys from 54.93.244.53
debug1: Host ‘54.93.244.53’ is known and matches the ECDSA host key.
debug1: Found key in /var/lib/one/.ssh/known_hosts:119
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /var/lib/one/.ssh/id_rsa (0x563ddbe93030)
debug2: key: /var/lib/one/.ssh/id_dsa ((nil))
debug2: key: /var/lib/one/.ssh/id_ecdsa ((nil))
debug2: key: /var/lib/one/.ssh/id_ed25519 ((nil))
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_9869)

debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_9869)

debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:l5qDtqrxhoUcmKqm+S1GR8AnqYu91WVxg5W1qOUoxn0 /var/lib/one/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug2: input_userauth_pk_ok: fp SHA256:l5qDtqrxhoUcmKqm+S1GR8AnqYu91WVxg5W1qOUoxn0
debug3: sign_and_send_pubkey: RSA SHA256:l5qDtqrxhoUcmKqm+S1GR8AnqYu91WVxg5W1qOUoxn0
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to 54.93.244.53 ([54.93.244.53]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 4
debug1: Remote: /var/lib/one/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 4
debug1: Remote: /var/lib/one/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug1: Sending environment.
debug3: Ignored env LS_COLORS
debug1: Sending env LANG = C.UTF-8
debug2: channel 0: request env confirm 0
debug3: send packet: type 98
debug3: Ignored env SUDO_GID
debug3: Ignored env USERNAME
debug3: Ignored env SUDO_COMMAND
debug3: Ignored env USER
debug3: Ignored env PWD
debug3: Ignored env HOME
debug3: Ignored env SUDO_USER
debug3: Ignored env SUDO_UID
debug3: Ignored env MAIL
debug3: Ignored env SHELL
debug3: Ignored env TERM
debug3: Ignored env SHLVL
debug3: Ignored env LOGNAME
debug3: Ignored env PATH
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

You can see in bold the same key being accepted by the host but rejected by the VM

In the host you can access the container using lxc-attach one-<vm_id> inside you can check the contents of ~/.ssh/authorized_keys. By default the contextualization package sets up the SSH access for the root user of the container, not oneadmin. If you are using the oneadmin user in the frontend shell, then your commands are attempting to log you in as oneadmin inside the container.

Sorry, ofc there is no oneadmin user in the lxc container :sweat_smile:

But even if I try to ssh with users ubuntu or root I get a password request

I’ve been able to access the containter with lxc-attach and there isn’t a ssh folder at home

Thanks :slight_smile:

Do you have the contextualization package installed in the container ? If that package exists within the container and the VM Template has a defined contextualization, you should be able to get the context information working inside the container.

I don’t think it’s a context problem because the start script is executing properly, and the context file is being deployed

Also I was able to ssh to this container (same vm template on another machine) from another front-end.


CONTEXT = [
  FILES_DS = "$FILE[IMAGE=\"client.py\", IMAGE_UNAME=\"oneadmin\"]",
  NETWORK = "YES",
  SET_HOSTNAME = "$NAME",
  SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]",
  START_SCRIPT = "the code here is working" 
]

If it’s useful i’m using the container “ubuntu_focal - LXD” from Linux Containers

Could you verify

  • The ip address is set on the network interface
  • The authorized key file of the root user /root/.ssh/authorized_keys of the container is populated

The context section you have should make it possible to ssh to the root user of the container (but none other)

  • IP address is set on the network interface, as you can see in the template bellow

I’ve also found that even though I have SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]" in the template, once it’s running the vm seems to not have been able to pick that key: SSH_PUBLIC_KEY = ""

template on running vm

This text will be hidden

User template
HOT_RESIZE = [
  CPU_HOT_ADD_ENABLED = "NO",
  MEMORY_HOT_ADD_ENABLED = "NO" ]
HYPERVISOR = "lxc"
INPUTS_ORDER = ""
LXD_SECURITY_PRIVILEGED = "true"
MEMORY_UNIT_COST = "MB"
SCHED_MESSAGE = ""
SCHED_REQUIREMENTS = "HYPERVISOR=\"lx*\""
Template
AUTOMATIC_DS_REQUIREMENTS = "(\"CLUSTERS/ID\" @> 0 | \"CLUSTERS/ID\" @> 120 | \"CLUSTERS/ID\" @> 121)"
AUTOMATIC_NIC_REQUIREMENTS = "(\"CLUSTERS/ID\" @> 0 | \"CLUSTERS/ID\" @> 120 | \"CLUSTERS/ID\" @> 121)"
AUTOMATIC_REQUIREMENTS = "(CLUSTER_ID = 0 | CLUSTER_ID = 120 | CLUSTER_ID = 121) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED)"
CONTEXT = [
  DISK_ID = "1",
  ETH0_DNS = "8.8.8.8 8.8.4.4",
  ETH0_EXTERNAL = "",
  ETH0_GATEWAY = "10.0.167.154",
  ETH0_GATEWAY6 = "",
  ETH0_IP = "10.0.167.155",
  ETH0_IP6 = "",
  ETH0_IP6_GATEWAY = "",
  ETH0_IP6_METHOD = "",
  ETH0_IP6_METRIC = "",
  ETH0_IP6_PREFIX_LENGTH = "",
  ETH0_IP6_ULA = "",
  ETH0_MAC = "02:00:0a:00:a7:9b",
  ETH0_MASK = "255.255.255.254",
  ETH0_METHOD = "",
  ETH0_METRIC = "",
  ETH0_MTU = "",
  ETH0_NETWORK = "",
  ETH0_SEARCH_DOMAIN = "",
  ETH0_VLAN_ID = "",
  ETH0_VROUTER_IP = "",
  ETH0_VROUTER_IP6 = "",
  ETH0_VROUTER_MANAGEMENT = "",
  FILES_DS = "/var/lib/one//datastores/2/db6c9110f4fd8c8aefee9657a5f09f0d:'client.py' ",
  NETWORK = "YES",
  SET_HOSTNAME = "from_cli-212",
  SSH_PUBLIC_KEY = "", 
  START_SCRIPT = "sudo apt update
  sudo apt install python3-pip --yes
  pip3 install --upgrade pip
  pip3 install flwr==0.17
  pip3 install keras==2.6.0
  pip3 install tensorflow-cpu==2.6.0
  sudo apt install vnstati --yes
  sudo apt-get install tcpdump -y
  sudo tcpdump -i eth0 port 8080 -s 65535 -w /tmp/wireshark.pcap &
  python3 /context/client.py --position 10 --nodes 10 &> /tmp/output.txt
  sudo pkill -f tcpdump
  sudo chmod 666 /tmp/wireshark.pcap
  vnstati -s -o /tmp/network.png",
  TARGET = "hda" ]
CPU = "1"
DISK = [
  ALLOW_ORPHANS = "YES",
  CLONE = "YES",
  CLONE_TARGET = "SYSTEM",
  CLUSTER_ID = "0,120,121",
  DATASTORE = "default",
  DATASTORE_ID = "1",
  DEV_PREFIX = "sd",
  DISK_ID = "0",
  DISK_SNAPSHOT_TOTAL_SIZE = "0",
  DISK_TYPE = "FILE",
  DRIVER = "raw",
  FORMAT = "raw",
  IMAGE = "ubuntu_focal - LXD",
  IMAGE_ID = "2",
  IMAGE_STATE = "2",
  IMAGE_UNAME = "oneadmin",
  LN_TARGET = "SYSTEM",
  ORIGINAL_SIZE = "1024",
  READONLY = "NO",
  SAVE = "NO",
  SIZE = "5000",
  SOURCE = "/var/lib/one//datastores/1/37eff79b661e816ffe5e218194e4ed9a",
  TARGET = "sda",
  TM_MAD = "ssh",
  TYPE = "FILE" ]
GRAPHICS = [
  LISTEN = "0.0.0.0",
  PORT = "6112",
  TYPE = "VNC" ]
MEMORY = "1500"
NIC = [
  AR_ID = "4",
  AWS_ALLOCATION_ID = "eipalloc-0831a6cd201b47344",
  BRIDGE = "br0",
  BRIDGE_TYPE = "linux",
  CLUSTER_ID = "120",
  EXTERNAL_IP = "52.28.167.155",
  GATEWAY = "10.0.167.154",
  IP = "10.0.167.155",
  MAC = "02:00:0a:00:a7:9b",
  NAME = "NIC0",
  NETWORK = "frankfurt-cluster-public",
  NETWORK_ID = "20",
  NETWORK_MODE = "auto",
  NIC_ID = "0",
  SECURITY_GROUPS = "0",
  TARGET = "one-212-0",
  VN_MAD = "elastic" ]
OS = [
  BOOT = "",
  UUID = "0fa06ca1-50c9-42c2-a333-69a640a3438d" ]
SECURITY_GROUP_RULE = [
  PROTOCOL = "ALL",
  RULE_TYPE = "OUTBOUND",
  SECURITY_GROUP_ID = "0",
  SECURITY_GROUP_NAME = "default" ]
SECURITY_GROUP_RULE = [
  PROTOCOL = "ALL",
  RULE_TYPE = "INBOUND",
  SECURITY_GROUP_ID = "0",
  SECURITY_GROUP_NAME = "default" ]
TEMPLATE_ID = "220"
TM_MAD_SYSTEM = "ssh"
VMID = "212"
  • There is no .ssh folder at /root/

image

I’ve also found that even though I have SSH_PUBLIC_KEY = "$USER[SSH_PUBLIC_KEY]" in the template, once it’s running the vm seems to not have been able to pick that key: SSH_PUBLIC_KEY = ""

Maybe worth checking the SSH_PUBLIC_KEY attribute of the user that owns the VM ?

  • There is no .ssh folder at /root/

If you check if the context daemon inside the container got the information, please check the file /context/context.sh inside the container. It should contain a list of the context related variables.

1 Like

Thanks! It works after setting up that attribute

I think this should be included in the documentation, because I had to follow this older post to add it [SOLVED] How todo I provide ssh_public_key the correct way

Maybe here? Advanced SSH Usage — OpenNebula 6.2.0 documentation

It is already included in the user management section.

These attributes can be later used in the Virtual Machine Contextualization. For example, using contextualization the user’s public ssh key can be automatically installed in the VM:

But if you feel like there is a better way, please feel free to open a new issue with the documentation label regarding this.