SSH for User in admins group does not work

Started by jke, April 07, 2025, 10:10:24 PM

Previous topic - Next topic
Quote from: Patrick M. Hausen on April 08, 2025, 12:12:48 AMTry "id <user>" on OPNsense and "ssh -v ..." from the external system to get more debug info.
root@OPNsense:~ # id github-runner
id: github-runner: no such user

github-runner@runner-1:~$ ssh -v 10.1.0.1 -p 2222
OpenSSH_9.6p1 Ubuntu-3ubuntu13.9, OpenSSL 3.0.13 30 Jan 2024
debug1: Reading configuration data /runner/.ssh/config
debug1: /runner/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 10.1.0.1 [10.1.0.1] port 2222.
debug1: Connection established.
debug1: identity file /runner/.ssh/id_ed25519 type 3
debug1: identity file /runner/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_9.9 FreeBSD-openssh-portable-9.9.p2_1,1
debug1: compat_banner: match: OpenSSH_9.9 FreeBSD-openssh-portable-9.9.p2_1,1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.1.0.1:2222 as 'github-runner'
debug1: load_hostkeys: fopen /runner/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:ap8uNQSdCZ0vwEBaiulo6GXdDiqup6KOH9egGfi8y60
debug1: load_hostkeys: fopen /runner/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host '[10.1.0.1]:2222' is known and matches the ED25519 host key.
debug1: Found key in /runner/.ssh/known_hosts:4
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: Sending SSH2_MSG_EXT_INFO
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=<0>
debug1: kex_ext_info_check_ver: ping@openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Will attempt key: /runner/.ssh/id_ed25519 ED25519 SHA256:7vQBdTAhIVJCRnHC2K3KNfUglYKfFQz0e1jE+5T5pZ8 explicit
debug1: Offering public key: /runner/.ssh/id_ed25519 ED25519 SHA256:7vQBdTAhIVJCRnHC2K3KNfUglYKfFQz0e1jE+5T5pZ8 explicit
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
github-runner@10.1.0.1: Permission denied (publickey).

Oh no!
Forget my last replies.
I guess after removing the user with vipw the OPNsense was clean.

But while testing i reused the command with ssh root@... and got more Permission denied errors.
Then, when posting the ssh -v output, the user wasn't recreated before the attempt.

I can now connect to the OPNsense. Thank you both very much for your help!