ssh localhost: Permission denied (publickey) Ubuntu on WSL2 (2023)

I'm having trouble "sshing" to localhost and getting a permission denied. I have tried everything from root or using sudo as well.

I'm having trouble "sshing" to localhost and getting a permission denied. I have tried everything from root or using sudo as well.

Ran the following:

ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsacat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keyscat /root/.ssh/id_rsa.pub >> ~/.ssh/authorized_keyschmod 0600 ~/.ssh/authorized_keysssh localhost

As the root user I have also done the following in case I use either user and the directories get mixed up:

cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keyscat /home/shervleradvm/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

First time was because the service was not running. So I did sudo service ssh start
I have also disabled the ufw for the test. sudo ufw disable
read/write permissions on the key files are

drwx------ 2 shervleradvm shervleradvm 4096 Nov 21 23:15 .drwxr-xr-x 6 shervleradvm shervleradvm 4096 Nov 21 23:25 ..-rw-r----- 1 shervleradvm shervleradvm 1146 Nov 21 23:23 authorized_keys-r-------- 1 root shervleradvm 2610 Nov 18 13:17 id_rsa-r-------- 1 shervleradvm shervleradvm 577 Nov 18 13:17 id_rsa.pub-rw-r--r-- 1 shervleradvm shervleradvm 444 Nov 18 15:05 known_hosts

sshd_config file was missing the following so I added and tested each and combinations of:

  • AllowUsers: added shervleradvm
  • AuthorizedKeysFile: added ~/.ssh/authorized_keys /root/.ssh/authorized_keys

I then changed my config file a little after reading Please explain the complete steps involved in the installation of OpenSSH server on Ubuntu so now it looks like:

# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $# This is the sshd server system-wide configuration file. See# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin# The strategy used for options in the default sshd_config shipped with# OpenSSH is to specify options with their default value where# possible, but leave them commented. Uncommented options override the# default value.Include /etc/ssh/sshd_config.d/*.conf#Port 22#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress ::#HostKey /etc/ssh/ssh_host_rsa_key#HostKey /etc/ssh/ssh_host_ecdsa_key#HostKey /etc/ssh/ssh_host_ed25519_key# Ciphers and keying#RekeyLimit default none# Logging#SyslogFacility AUTH########################################## EDITEDLogLevel VERBOSE################################################### Authentication:############################################################## NEW STUFF ############AllowUsers shervleradvm root ######################################################################################LoginGraceTime 2m########################################### EDITEDPermitRootLogin yes###################################################StrictModes yes#MaxAuthTries 6#MaxSessions 10PubkeyAuthentication yes# Expect .ssh/authorized_keys2 to be disregarded by default in future.########################################################################### EDITEDAuthorizedKeysFile ~/.ssh/authorized_keys /root/.ssh/authorized_keys#AuthorizedPrincipalsFile none#AuthorizedKeysCommand none#AuthorizedKeysCommandUser nobody# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts#HostbasedAuthentication no# Change to yes if you don't trust ~/.ssh/known_hosts for# HostbasedAuthentication#IgnoreUserKnownHosts no# Don't read the user's ~/.rhosts and ~/.shosts files#IgnoreRhosts yes# To disable tunneled clear text passwords, change to no here!PasswordAuthentication no#PermitEmptyPasswords no# Change to yes to enable challenge-response passwords (beware issues with# some PAM modules and threads)ChallengeResponseAuthentication no# Kerberos options#KerberosAuthentication no#KerberosOrLocalPasswd yes#KerberosTicketCleanup yes#KerberosGetAFSToken no# GSSAPI options#GSSAPIAuthentication no#GSSAPICleanupCredentials yes#GSSAPIStrictAcceptorCheck yes#GSSAPIKeyExchange no# Set this to 'yes' to enable PAM authentication, account processing,# and session processing. If this is enabled, PAM authentication will# be allowed through the ChallengeResponseAuthentication and# PasswordAuthentication. Depending on your PAM configuration,# PAM authentication via ChallengeResponseAuthentication may bypass# the setting of "PermitRootLogin without-password".# If you just want the PAM account and session checks to run without# PAM authentication, then enable this but set PasswordAuthentication# and ChallengeResponseAuthentication to 'no'.UsePAM yes#AllowAgentForwarding yes############################################ EDITEDAllowTcpForwarding no#####################################################GatewayPorts no############################################ EDITEDX11Forwarding no#####################################################X11DisplayOffset 10#X11UseLocalhost yes#PermitTTY yesPrintMotd no#PrintLastLog yes#TCPKeepAlive yes#PermitUserEnvironment no#Compression delayed#ClientAliveInterval 0#ClientAliveCountMax 3#UseDNS no#PidFile /var/run/sshd.pid#MaxStartups 10:30:100#PermitTunnel no#ChrootDirectory none#VersionAddendum none# no default banner path########################################## EDITEDBanner /etc/issue.net###################################################### Allow client to pass locale environment variablesAcceptEnv LANG LC_*# override default of no subsystemsSubsystem sftp /usr/lib/openssh/sftp-server# Example of overriding settings on a per-user basis#Match User anoncvs# X11Forwarding no# AllowTcpForwarding no# PermitTTY no# ForceCommand cvs server

I'm not sure what else I can try I've been stuck on this for days and I have read all the other questions regarding ssh.

The verbose output is:

OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f 31 Mar 2020debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no filesdebug1: /etc/ssh/ssh_config line 21: Applying options for *debug1: Connecting to localhost [127.0.0.1] port 22.debug1: Connection established.debug1: identity file /home/shervleradvm/.ssh/id_rsa type 0debug1: identity file /home/shervleradvm/.ssh/id_rsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_dsa type -1debug1: identity file /home/shervleradvm/.ssh/id_dsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa_sk type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa_sk-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519 type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519_sk type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519_sk-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_xmss type -1debug1: identity file /home/shervleradvm/.ssh/id_xmss-cert type -1debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.1debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 pat OpenSSH* compat 0x04000000debug1: Authenticating to localhost:22 as 'shervleradvm'debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: algorithm: curve25519-sha256debug1: kex: host key algorithm: ecdsa-sha2-nistp256debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: nonedebug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: nonedebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: ecdsa-sha2-nistp256 SHA256:RhXPmgq8gMMrSRv7+VlpLb84pRnXi2vDiqdg0EfocK0debug1: Host 'localhost' is known and matches the ECDSA host key.debug1: Found key in /home/shervleradvm/.ssh/known_hosts:1debug1: rekey out after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: rekey in after 134217728 blocksdebug1: Will attempt key: /home/shervleradvm/.ssh/id_rsa RSA SHA256:WfkneDotRaioAvWLHi+4L0CpHg+EZ8cWMPPGbx/jUXQdebug1: Will attempt key: /home/shervleradvm/.ssh/id_dsadebug1: Will attempt key: /home/shervleradvm/.ssh/id_ecdsadebug1: Will attempt key: /home/shervleradvm/.ssh/id_ecdsa_skdebug1: Will attempt key: /home/shervleradvm/.ssh/id_ed25519debug1: Will attempt key: /home/shervleradvm/.ssh/id_ed25519_skdebug1: Will attempt key: /home/shervleradvm/.ssh/id_xmssdebug1: SSH2_MSG_EXT_INFO receiveddebug1: 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>debug1: SSH2_MSG_SERVICE_ACCEPT received*************************************************************************** SOME BANNER I HAVE PUTThis computer system is the private property of its owner, whetherindividual, corporate or government. It is for authorized use only.Users (authorized or unauthorized) have no explicit or implicitexpectation of privacy.Any or all uses of this system and all files on this system may beintercepted, monitored, recorded, copied, audited, inspected, anddisclosed to your employer, to authorized site, government, and lawenforcement personnel, as well as authorized officials of governmentagencies, both domestic and foreign.By using this system, the user consents to such interception, monitoring,recording, copying, auditing, inspection, and disclosure at thediscretion of such personnel or officials. Unauthorized or improper useof this system may result in civil and criminal penalties andadministrative or disciplinary action, as appropriate. By continuing touse this system you indicate your awareness of and consent to these termsand conditions of use. LOG OFF IMMEDIATELY if you do not agree to theconditions stated in this warning.****************************************************************************debug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/shervleradvm/.ssh/id_rsa RSA SHA256:WfkneDotRaioAvWLHi+4L0CpHg+EZ8cWMPPGbx/jUXQdebug1: Authentications that can continue: publickeydebug1: Trying private key: /home/shervleradvm/.ssh/id_dsadebug1: Trying private key: /home/shervleradvm/.ssh/id_ecdsadebug1: Trying private key: /home/shervleradvm/.ssh/id_ecdsa_skdebug1: Trying private key: /home/shervleradvm/.ssh/id_ed25519debug1: Trying private key: /home/shervleradvm/.ssh/id_ed25519_skdebug1: Trying private key: /home/shervleradvm/.ssh/id_xmssdebug1: No more authentication methods to try.shervleradvm@localhost: Permission denied (publickey).

UPDATE 1:the syslog in /var/log/syslog only says:

Nov 20 01:05:54 ShervLeRad kernel: [35460.503034] WSL2: Performing memory compaction.Nov 20 01:06:55 ShervLeRad kernel: [35521.519400] WSL2: Performing memory compaction.Nov 20 01:07:56 ShervLeRad kernel: [35582.535366] WSL2: Performing memory compaction.Nov 20 01:08:57 ShervLeRad kernel: [35643.552061] WSL2: Performing memory compaction.Nov 20 01:09:58 ShervLeRad kernel: [35704.567029] WSL2: Performing memory compaction.Nov 20 01:10:59 ShervLeRad kernel: [35765.582427] WSL2: Performing memory compaction.Nov 20 01:12:00 ShervLeRad kernel: [35826.597374] WSL2: Performing memory compaction.

the auth.log in /var/log/auth.log says:

Nov 19 18:48:34 ShervLeRad sudo: shervleradvm : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/ssh localhostNov 19 18:48:34 ShervLeRad sudo: pam_unix(sudo:session): session opened for user root by (uid=0)Nov 19 18:48:34 ShervLeRad sshd[7026]: Connection closed by authenticating user root 127.0.0.1 port 39490 [preauth]Nov 19 18:48:34 ShervLeRad sudo: pam_unix(sudo:session): session closed for user rootNov 19 18:48:37 ShervLeRad sudo: shervleradvm : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/usr/bin/vim sshd_configNov 19 18:48:37 ShervLeRad sudo: pam_unix(sudo:session): session opened for user root by (uid=0)Nov 19 18:48:51 ShervLeRad sudo: pam_unix(sudo:session): session closed for user root

UPDATE 2:I ran ssh with -vvv and the output is:

OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f 31 Mar 2020debug1: Reading configuration data /etc/ssh/ssh_configdebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no filesdebug1: /etc/ssh/ssh_config line 21: Applying options for *debug2: resolving "localhost" port 22debug2: ssh_connect_directdebug1: Connecting to localhost [127.0.0.1] port 22.debug1: Connection established.debug1: identity file /home/shervleradvm/.ssh/id_rsa type 0debug1: identity file /home/shervleradvm/.ssh/id_rsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_dsa type -1debug1: identity file /home/shervleradvm/.ssh/id_dsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa_sk type -1debug1: identity file /home/shervleradvm/.ssh/id_ecdsa_sk-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519 type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519_sk type -1debug1: identity file /home/shervleradvm/.ssh/id_ed25519_sk-cert type -1debug1: identity file /home/shervleradvm/.ssh/id_xmss type -1debug1: identity file /home/shervleradvm/.ssh/id_xmss-cert type -1debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.1debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.1debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.1 pat OpenSSH* compat 0x04000000debug2: fd 3 setting O_NONBLOCKdebug1: Authenticating to localhost:22 as 'shervleradvm'debug3: hostkeys_foreach: reading file "/home/shervleradvm/.ssh/known_hosts"debug3: record_hostkey: found key type ECDSA in file /home/shervleradvm/.ssh/known_hosts:1debug3: load_hostkeys: loaded 1 keys from localhostdebug3: 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-nistp521debug3: send packet: type 20debug1: SSH2_MSG_KEXINIT sentdebug3: receive packet: type 20debug1: SSH2_MSG_KEXINIT receiveddebug2: local client KEXINIT proposaldebug2: 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,ext-info-cdebug2: 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,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsadebug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.comdebug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.comdebug2: 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-sha1debug2: 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-sha1debug2: compression ctos: none,zlib@openssh.com,zlibdebug2: compression stoc: none,zlib@openssh.com,zlibdebug2: languages ctos:debug2: languages stoc:debug2: first_kex_follows 0debug2: reserved 0debug2: peer server KEXINIT proposaldebug2: 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-sha256debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.comdebug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.comdebug2: 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-sha1debug2: 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-sha1debug2: compression ctos: none,zlib@openssh.comdebug2: compression stoc: none,zlib@openssh.comdebug2: languages ctos:debug2: languages stoc:debug2: first_kex_follows 0debug2: reserved 0debug1: kex: algorithm: curve25519-sha256debug1: kex: host key algorithm: ecdsa-sha2-nistp256debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: nonedebug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: nonedebug3: send packet: type 30debug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug3: receive packet: type 31debug1: Server host key: ecdsa-sha2-nistp256 SHA256:RhXPmgq8gMMrSRv7+VlpLb84pRnXi2vDiqdg0EfocK0debug3: hostkeys_foreach: reading file "/home/shervleradvm/.ssh/known_hosts"debug3: record_hostkey: found key type ECDSA in file /home/shervleradvm/.ssh/known_hosts:1debug3: load_hostkeys: loaded 1 keys from localhostdebug1: Host 'localhost' is known and matches the ECDSA host key.debug1: Found key in /home/shervleradvm/.ssh/known_hosts:1debug3: send packet: type 21debug2: set_newkeys: mode 1debug1: rekey out after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug3: receive packet: type 21debug1: SSH2_MSG_NEWKEYS receiveddebug2: set_newkeys: mode 0debug1: rekey in after 134217728 blocksdebug1: Will attempt key: /home/shervleradvm/.ssh/id_rsa RSA SHA256:WfkneDotRaioAvWLHi+4L0CpHg+EZ8cWMPPGbx/jUXQdebug1: Will attempt key: /home/shervleradvm/.ssh/id_dsadebug1: Will attempt key: /home/shervleradvm/.ssh/id_ecdsadebug1: Will attempt key: /home/shervleradvm/.ssh/id_ecdsa_skdebug1: Will attempt key: /home/shervleradvm/.ssh/id_ed25519debug1: Will attempt key: /home/shervleradvm/.ssh/id_ed25519_skdebug1: Will attempt key: /home/shervleradvm/.ssh/id_xmssdebug2: pubkey_prepare: donedebug3: send packet: type 5debug3: receive packet: type 7debug1: SSH2_MSG_EXT_INFO receiveddebug1: 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 6debug2: service_accept: ssh-userauthdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug3: send packet: type 50debug3: receive packet: type 53debug3: input_userauth_banner*************************************************************************** NOTICE TO USERSThis computer system is the private property of its owner, whetherindividual, corporate or government. It is for authorized use only.Users (authorized or unauthorized) have no explicit or implicitexpectation of privacy.Any or all uses of this system and all files on this system may beintercepted, monitored, recorded, copied, audited, inspected, anddisclosed to your employer, to authorized site, government, and lawenforcement personnel, as well as authorized officials of governmentagencies, both domestic and foreign.By using this system, the user consents to such interception, monitoring,recording, copying, auditing, inspection, and disclosure at thediscretion of such personnel or officials. Unauthorized or improper useof this system may result in civil and criminal penalties andadministrative or disciplinary action, as appropriate. By continuing touse this system you indicate your awareness of and consent to these termsand conditions of use. LOG OFF IMMEDIATELY if you do not agree to theconditions stated in this warning.****************************************************************************debug3: receive packet: type 51debug1: Authentications that can continue: publickeydebug3: start over, passed a different list publickeydebug3: preferred gssapi-with-mic,publickey,keyboard-interactive,passworddebug3: authmethod_lookup publickeydebug3: remaining preferred: keyboard-interactive,passworddebug3: authmethod_is_enabled publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/shervleradvm/.ssh/id_rsa RSA SHA256:WfkneDotRaioAvWLHi+4L0CpHg+EZ8cWMPPGbx/jUXQdebug3: send packet: type 50debug2: we sent a publickey packet, wait for replydebug3: receive packet: type 51debug1: Authentications that can continue: publickeydebug1: Trying private key: /home/shervleradvm/.ssh/id_dsadebug3: no such identity: /home/shervleradvm/.ssh/id_dsa: No such file or directorydebug1: Trying private key: /home/shervleradvm/.ssh/id_ecdsadebug3: no such identity: /home/shervleradvm/.ssh/id_ecdsa: No such file or directorydebug1: Trying private key: /home/shervleradvm/.ssh/id_ecdsa_skdebug3: no such identity: /home/shervleradvm/.ssh/id_ecdsa_sk: No such file or directorydebug1: Trying private key: /home/shervleradvm/.ssh/id_ed25519debug3: no such identity: /home/shervleradvm/.ssh/id_ed25519: No such file or directorydebug1: Trying private key: /home/shervleradvm/.ssh/id_ed25519_skdebug3: no such identity: /home/shervleradvm/.ssh/id_ed25519_sk: No such file or directorydebug1: Trying private key: /home/shervleradvm/.ssh/id_xmssdebug3: no such identity: /home/shervleradvm/.ssh/id_xmss: No such file or directorydebug2: we did not send a packet, disable methoddebug1: No more authentication methods to try.shervleradvm@localhost: Permission denied (publickey).

UPDATE 3:

I just tried ssh -i id_rsa localhost from ~/.ssh dir of shervleradvm user to try defining private_key to use. That didn't work. So I did touch config && vim config then I defined the private key for the localhost:

Host localhost HostName localhost User shervleradvm IdentityFile ~/.ssh/id_rsa

and then ran ssh localhost. The error presists.

UPDATE 4:I changed the owner of the private key to shervleradvm and gave the following permissions:

-rw------- 1 shervleradvm shervleradvm 2610 Nov 18 13:17 id_rsa-r-------- 1 shervleradvm shervleradvm 577 Nov 18 13:17 id_rsa.pub

didn't help.

Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated: 26/12/2023

Views: 6142

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.