Quote:
Originally Posted by Turbocapitalist
How are you invoking the SSH session? The exact command would help and if there is an error message with -v or -v -v that would help too.
Did you have any special settings in ~/.ssh/config and how are the permissions for the private keys?
|
I try connecting with: ssh -i .ssh/KEY user@ip
I created the keys with: ssh-keygen -t rsa -f ~/.ssh/KEY -C user
I copy the content of the .pub file created to the authorized_keys file on the server, but without any change in result. Its a Google compute VM, and they have a specific page where existing keys can be edited under web interface which I have also done. After adding it to the web interface, I can see the same line added to autorized_keys as if I did it manually.
Here is a copy of the log with -v (users and hosts redacted):
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
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 xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file .ssh/KEY type 0
debug1: identity file .ssh/KEY-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u8
debug1: compat_banner: match: OpenSSH_6.7p1 Debian-5+deb8u8 pat OpenSSH* compat 0x04000000
debug1: Authenticating to xxx.xxx.xxx.xxx:22 as 'user'
debug1: load_hostkeys: fopen /home/xxx/.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:
curve25519-sha256@libssh.org
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:IdH410ytoj2G2Hc1TsFrkT74OutSXlxddUzlm/ehpos
debug1: load_hostkeys: fopen /home/xxx/.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 'xxx.xxx.xxx.xxx' is known and matches the ED25519 host key.
debug1: Found key in /home/xxx/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: agent returned 1 keys
debug1: Will attempt key: .ssh/KEY RSA SHA256:lIhpMIOC08sTCGm+SZK55aWcO+w7gJOFWYbFF67a6Pk explicit agent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: .ssh/KEY RSA SHA256:lIhpMIOC08sTCGm+SZK55aWcO+w7gJOFWYbFF67a6Pk explicit agent
debug1: send_pubkey_test: no mutual signature algorithm
debug1: No more authentication methods to try.
user@xxx.xxx.xxx.xxx: Permission denied (publickey).
Quote:
Originally Posted by elgrandeperro
|
Yes, these permissions are all as mentioned.