$ sudo nano /etc/ssh/sshd_config
And putting these lines in, or uncommenting as required, and saving / write-out:
# Authentication:
PermitRootLogin yes
Then I needed to access the root account, so I issue:
$ sudo su
# cd /root
# mkdir .ssh
# cd .ssh
# nano authorized_keys
Then put the relevant public key in here, I pasted mine in from near the top of Putty-Gen, and save / write-out.
Then restart the sshd daemon, still as root, with:
# systemctl restart sshd
# exit
# exit
Then after I’d added the relevant .ppk file in my SSH Auth within Putty, it worked like a charm!
In this article you will learn How to Allow SSH Root Login on Ubuntu 20.04 LTS Linux step by step.

But root SSH login can be enabled by editing OpenSSH daemon (sshd) configuration.
WARNING! Using SSH root login is a bad idea!
Step 1
$ vim /etc/ssh/sshd_config
Step 2
Find commented PermitRootLogin parameter or manually add
PermitRootLogin yes
As shown on image:

Step 3
After finish editing configuration file save and close it.
For the changes to take effect, you must restart sshd daemon.
$ sudo systemctl restart ssh
Step 4
Now we need set password for the root with using passwd command:
$ sudo passwd root
$ sudo passwd root New password: Retype new password: passwd: password updated successfully
Now you will be able SSH login as root to your Ubuntu server
$ ssh [email protected]
Conclusion
Enable SSH Root Login on Ubuntu
To enable Root Login on Ubuntu edit sshd daemon configuration PermitRootLogin parameter to:
1. PermitRootLogin yes
2. Save changes
3. Restart sshd daemon
4. Set password for the root with using passwd command
Discuss article in ArsTech Forum
Read also: How To Setup SSH: Public Key Authentication On Linux
If you like what you are reading, please:
Buy me a coffee
I’m using this .ssh/config:
Host myserver
HostName 12.34.67.89
User anyuser
IdentityFile /root/.ssh/anything_rsa
But running ssh myserver
returns a Permission denied (publickey)
error.
Why isn’t the given identity file (root/.ssh/anything_rsa
) be used? Instead it seems to use /root/.ssh/id_rsa
OpenSSH_7.0p1, OpenSSL 1.0.1r 28 Jan 2016
debug1: Connecting to myserver [12.34.67.89] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to myserver:22 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: XXXXX
debug1: Host 'myserver' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:4
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
asked Apr 27, 2019 at 19:45
7 gold badges20 silver badges34 bronze badges
For purposes of troubleshooting, consider trying:
cd ~admin
mkdir .ssh
chmod 700 .ssh
cp -RLp /etc/config/ssh/* .ssh
chown -R admin .ssh
Then try again.
answered Apr 27, 2019 at 20:10
Jim L.
1 gold badge13 silver badges25 bronze badges
You need to set IdentitiesOnly yes
in your ~/.ssh/config
(or global /etc/ssh/ssh_config
), otherwise all other available identities are also tried.
With IdentitiesOnly yes
only the identities defined with IdentityFile
(and certificates defined with CertificateFile
) will be used (if not passed on the command-line).
Host myserver
HostName 12.34.67.89
User anyuser
IdentitiesOnly yes
IdentityFile /root/.ssh/anything_rsa
answered Apr 27, 2019 at 20:13
1 gold badge20 silver badges59 bronze badges
If somebody came to this thread like I am because of trying to establish SSH from QNAP NAS to linux machine, here is the answer:
ssh root@hostname
which returned an error. But
ssh -i /share/homes/admin/.ssh/id_rsa root@hostname
20 gold badges47 silver badges71 bronze badges
answered Apr 21 at 9:19
client:Mac 10.8,server:Ubuntu 10.04 LTS 64bit
I use ‘ssh-keygen -t rsa‘ generate public/private keys.
Host popo
Hostname popo.net
User root
PreferredAuthentications publickey
IdentityFile /Users/phenix/.ssh/poponet_rsa
My question: ssh cannot use the IdentityFile config in file ~/.ssh/config, why?
$ ssh -vvv root@popo.net
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/phenix/.ssh/config
debug1: /Users/phenix/.ssh/config line 1: Applying options for popo.net
debug1: /Users/phenix/.ssh/config line 2: Applying options for popo.net
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to popo.net [111.111.111.111] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/phenix/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/phenix/.ssh/id_rsa type -1
debug1: identity file /Users/phenix/.ssh/id_rsa-cert type -1
debug1: identity file /Users/phenix/.ssh/id_dsa type -1
debug1: identity file /Users/phenix/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7
debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "popo.net" from file "/Users/phenix/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/phenix/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: **too much init, i delete them.**
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 135/256
debug2: bits set: 468/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
debug3: load_hostkeys: loading entries for host "popo.net" from file "/Users/phenix/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/phenix/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "111.111.111.111" from file "/Users/phenix/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/phenix/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'popo.net' is known and matches the RSA host key.
debug1: Found key in /Users/phenix/.ssh/known_hosts:1
debug2: bits set: 516/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/phenix/.ssh/id_rsa (0x0)
debug2: key: /Users/phenix/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred 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: Trying private key: /Users/phenix/.ssh/id_rsa
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
debug2: no passphrase given, try next key
debug1: Trying private key: /Users/phenix/.ssh/id_dsa
debug3: no such identity: /Users/phenix/.ssh/id_dsa
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
root@popo.net's password:
I have 2x servers both of which I can ssh
to with public keys from OSX, no issues at all there so I’m certain everything is good with sshd_config
.
I’m trying to configure a cron job for rsync
to sync the two servers and need server B (backup) to ssh
into server A using a public key.
I cannot for the life of me work out why it doesn’t find my public keys — they are in ~/.ssh/
(ie. /root/.ssh
) and all file permissions are correct on A & B.
This is the output:
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: Trying private key: /root/.ssh/identity
debug3: no such identity: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug3: no such identity: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa
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
drwx------. 2 root root 4096 May 25 10:15 .
dr-xr-x---. 4 root root 4096 May 24 18:52 ..
-rw-------. 1 root root 403 May 25 01:37 authorized_keys
-rw-------. 1 root root 0 May 25 01:41 config
-rw-------. 1 root root 1675 May 25 02:35 id_rsa_tm1
-rw-------. 1 root root 405 May 25 02:35 id_rsa_tm1.pub
-rw-------. 1 root root 395 May 25 02:36 known_hosts
asked May 25, 2014 at 10:14
A malformed authorized_keys file on the destination host is another reason ssh outputs the «we did not send a packet» message and asks for a password instead of using pubkey auth:-
debug1: Next authentication method: publickey
debug1: Offering RSA public key: ~/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
The problem in this particular case was that the public key data, which had been pasted into .ssh/authorized_keys
at the destination host, was missing its first character:-
sh-rsa AAAA...
The solution was simply to add the missing «s».
ssh-rsa AAAA...
debug1: Next authentication method: publickey
debug1: Offering RSA public key: ~/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
...
debug1: Authentication succeeded (publickey).
answered May 6, 2016 at 19:56
1 gold badge5 silver badges9 bronze badges
Have a look at your ssh man page:
-i identity_file
Selects a file from which the identity (private key) for public
key authentication is read. The default is ~/.ssh/identity for
protocol version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa,
~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2.
Identity files may also be specified on a per-host basis in the
configuration file. It is possible to have multiple -i options
(and multiple identities specified in configuration files).
or the ssh_config man page:
IdentityFile
Specifies a file from which the user's DSA, ECDSA, ED25519 or
RSA authentication identity is read. The default is
~/.ssh/identity for protocol version 1, and ~/.ssh/id_dsa,
~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for proto‐
col version 2. Additionally, any identities represented by the
authentication agent will be used for authentication unless
IdentitiesOnly is set.
You see, there are a few special file names which are tried if you do not specify a key. Those are also the files you see in your log output.
To use a key in a file with different name you have three options:
- specify the file explicitly using the above
-i
option. - configure the file in your client config using the above
IdentityFile
option. - add the key to your agent using
ssh-add
.
For interactive sessions the agent is the most flexible one. For your cron job the -i
option is probably the easiest one.
answered May 25, 2014 at 11:34
4 gold badges62 silver badges92 bronze badges
This exact string of error messages in the question can also occur in the case of a miss-matched private/public key pair on the local side. No that doesn’t make any sense but I just tore my hair out for a long time trying to figure out what was going on.
- Remote system A has
.ssh/mykey.pub
copied into.ssh/authorized_keys
. - Local system B has
.ssh/mykey
that is the correct private key to match system A’s public key, but also has a.ssh/mykey.pub
file that is a miss-match, possibly the previous version of a replaced key.
SSH from B to A (ssh -i mykey A
)will fail with the messages in the question, most notably if you turn on -vv
from the ssh client you’ll see:
Trying private key: .ssh/mykey
we did not send a packet, disable method
This is a lie because the actual key wasn’t tried, it apparently used the local public key file with the matching name to figure out if it was likely to work and then didn’t actually do anything when they were a mismatch. No amount of debug information on either side really hints at the problem.
answered Apr 16, 2016 at 15:21
18 gold badges196 silver badges226 bronze badges
Fixing home dir rights solved this.
9 silver badges23 bronze badges
answered May 20, 2015 at 9:25
1 silver badge1 bronze badge
The default file names ssh is looking for are id_rsa
and id_rsa.pub
.
If you want to use other file names, you either have to specify them in ssh_config
(using the IdentityFile
setting) or via the ssh command line
parameter -i
.
answered May 25, 2014 at 10:36
2 gold badges18 silver badges17 bronze badges
A simple way to debug in Debian/Ubuntu is:
Connect with password and tail the log
tail -f /var/log/auth.log
In my case the /root directory was 770 and not 700 which is the default
The error was «Authentication refused: bad ownership or modes for directory /root»
Fix this and you are done.
answered May 13, 2019 at 14:41
5 silver badges5 bronze badges
/sbin/restorecon -r /root/.ssh
A possible problem with selling context
answered Mar 14, 2015 at 16:39
It may be the account you’re logging in as (on the remote system) does not have read access to the public key file (on the remote system). For instance, in our environment we have a custom AuthorizedKeysFile
location specified in /etc/ssh/sshd_config
:
AuthorizedKeysFile /usr/local/etc/ssh_authorized_keys/%u_pub
And /usr/local/etc/
somehow had its permissions changed to:
drwx------. 3 root root 29 Feb 20 2018 /usr/local/etc/
Resolved by (re-) setting permissions to:
drwxr-xr-x. 3 root root 29 Feb 20 2018 /usr/local/etc/
answered Feb 24, 2020 at 19:25
Start a new SSH Server instance on a new port in debug mode with:
/usr/sbin/sshd -d -p 2222
then connect to it from the client with:
ssh -p 2222 user@host
answered Apr 18, 2020 at 13:09
answered Oct 16, 2020 at 4:49
ssh-keygen
It helped me.
answered Oct 31, 2016 at 4:16
vi ~/.ssh/config
Add both hostnames and their identity file as follows:
Host server1.nixcraft.com
IdentityFile ~/Users/.ssh/id_rsa1
Host server2.nixcraft.com
IdentityFile /backup/home/aymen/.ssh/id_rsa2
answered Sep 28, 2019 at 19:25
ssh -i file.pem -l admin admin@x.x.x.x
answered Jul 17, 2020 at 20:40
Found myself another typo
authorized_key
authorized_keys
answered Nov 22, 2021 at 20:27
vim /etc/ssh/ssh_config
#add your key
IdentityFile ~/.ssh/yourkey
service sshd restart
7 gold badges32 silver badges48 bronze badges
answered Feb 27, 2019 at 7:46
Currently this is my setup (ssh_config):
Host *
PasswordAuthentication yes
PermitRootLogin without-password
StrictModes no
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# GSSAPIKeyExchange no
# GSSAPITrustDNS no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Protocol 2
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
(output from sshd -d)
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g 1 Mar 2016
debug1: private host key #0: <key0>
debug1: private host key #1: <key1>
debug1: private host key #2: <key2>
debug1: private host key #3: <key3>
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
debug1: inetd sockets after dupping: 3, 3
Connection from <ip-client> port 51229 on <ip-server> port 22
debug1: Client protocol version 2.0; client software version OpenSSH_7.3
debug1: match: OpenSSH_7.3 pat OpenSSH* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: permanently_set_uid: 107/65534 [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256@libssh.org [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user root service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: PAM: initializing for "root"
debug1: PAM: setting PAM_RHOST to "<ip-client>"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user root service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOztKWHPzxkI [preauth]
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: matching key found: file /root/.ssh/authorized_keys, line 1 RSA SHA256:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOzFtWHPzxkI
debug1: restore_uid: 0/0
Postponed publickey for root from <ip-client> port 51229 ssh2 [preauth]
debug1: userauth-request for user root service ssh-connection method publickey [preauth]
debug1: attempt 2 failures 0 [preauth]
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: matching key found: file /root/.ssh/authorized_keys, line 1 RSA SHA256:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOzFtWHPzxkI
debug1: restore_uid: 0/0
ROOT LOGIN REFUSED FROM <ip-client>
Failed publickey for root from <ip-client> port 51229 ssh2: RSA SHA256:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOzFtKWHPzkI
ROOT LOGIN REFUSED FROM <ip-client> [preauth]
(output from login attempt -vvv)
OpenSSH_7.3p1, OpenSSL 1.0.2j 26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "<hostname>" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <hostname> [<server_ip>] port 22.
debug1: Connection established.
debug1: identity file dragonflame type 1
debug1: key_load_public: No such file or directory
debug1: identity file dragonflame-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to <hostname>:22 as 'root'
debug3: hostkeys_foreach: reading file "<user_path>.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file <user_path>.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from <hostname>
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@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,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc
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@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,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@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
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
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:fhpfMHmWqXoSHcM3rdkwMDFpb8pxIZnTqSo6IKpIqnw
debug3: hostkeys_foreach: reading file "<user_path>.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file <user_path>.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from <hostname>
debug3: hostkeys_foreach: reading file "<user_path>.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file <user_path>.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from <server_ip>
debug1: Host '<hostname>' is known and matches the ECDSA host key.
debug1: Found key in <user_path>.ssh/known_hosts:2
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
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: dragonflame (0x60006bcb0), explicit
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
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 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 RSA public key: dragonflame
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:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOzFtKWHPzxkI
debug3: sign_and_send_pubkey: RSA SHA256:N8vfYcI48gJ/9FlB8lXEkrKcZQvQ5EOOzFtKWHPzxkI
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
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
(output from ls -alF .ssh)
ls -alF .ssh
total 12
drwx------ 2 root root 4096 Jan 16 15:01 ./
drwx------ 10 root root 4096 Jan 16 04:26 ../
-rw------- 1 root root 405 Jan 16 15:00 authorized_keys
Is there something obvious I’m missing? Any ideas?
Thanks in advance!