Primero v2 install issue

Hi,

I seem to be running into an issue once I run the ansible-playbook bootstrap.yml.
root@primero:~/v2-deploy/primero/ansible# ansible-playbook bootstrap.yml

[WARNING]: Could not match supplied host pattern, ignoring: vpc
[WARNING]: Could not match supplied host pattern, ignoring: first_run
PLAY [!vpc:!first_run] **************************************************************************************************************
TASK [quoin.infrastructure.install_python3 : install Python version 3] **************************************************************************************************************
fatal: [primero.pennyappeal.local]: UNREACHABLE! => changed=false
msg: ‘Failed to connect to the host via ssh: root@primero.pennyappeal.local: Permission denied (publickey,gssapi-with-mic,password).’
unreachable: true
PLAY RECAP **************************************************************************************************************
primero.pennyappeal.local : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

Not sure what im missing, any assistances would be appreciated.

Thanks!

The user root has no permission to access

Thanks for the reply.
However this makes no sense, the whole process of installations has been done by root and root is the owner of the files. →
root@primero:~/v2-deploy/primero/ansible# ls -lah …/venv/bin/
total 344K
drwxr-xr-x 3 root root 4.0K Jul 14 08:40 .
drwxr-xr-x 4 root root 4.0K Jul 11 13:53 …
-rw-r–r-- 1 root root 2.1K Jul 11 13:53 activate

Unless im missing something else

So i’ve gone ahead and completely re-installed the vm and followed the configuration guide.
Once again at this step, its failing :
chris@primero:~/v2-deploy/primero/ansible$ source …/venv/bin/activate
(venv) chris@primero:~/v2-deploy/primero/ansible$ ansible-playbook bootstrap.yml
[WARNING]: Could not match supplied host pattern, ignoring: vpc
[WARNING]: Could not match supplied host pattern, ignoring: first_run

PLAY [!vpc:!first_run] ***************************************************************************************************************************************************************************************

TASK [quoin.infrastructure.install_python3 : install Python version 3] ***************************************************************************************************************************************
The authenticity of host ‘primero.pennyappeal.local (x.x.x.x)’ can’t be established.
ED25519 key fingerprint is SHA256:qasdasasasdasdasdasdasdasdasd
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
fatal: [primero.pennyappeal.local]: UNREACHABLE! => changed=false
msg: |-
Failed to connect to the host via ssh: Warning: Permanently added ‘primero.pennyappeal.local’ (ED25519) to the list of known hosts.
root@primero.pennyappeal.local: Permission denied (publickey,password).
unreachable: true

PLAY RECAP ***************************************************************************************************************************************************************************************************
primero.pennyappeal.local : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

I am starting to think it has something to do with my ssh config. Is there a chance you could send me a copy of what it should look like?

You are right, the issue is with ssh
You are trying to use ansible to install locally so you need to be able to ssh into your own macine. Basically you need to be able to open a terminal and run this command successfully:

ssh root@primero.pennyappeal.local

So as the root user you need to create an ssh key (if root does not have one) and provide the public part of that key to ansible.
Conceptually you can think of it like this:
You recently bought a safe for your house with a lock and key which you then place in your bedroom. Even if you turn up to your own house with your own passport and driving license you are not getting into the safe in your own bedroom without the safe key

Thanks for the reply, Okay so if I understand this correctly, log into root, create an ssh key and copy the private key into the secrets.yml?

Yes. Since it is local you can also copy the private ssh key to

/root/.ssh

and call it primero_deployment_key since this is what ansible needs to do its work

I’m either being dumb or confused, but still can’t get it to work.
This is my setup. I have a VM hosted on a private cloud (vmware) - logged in via the user I setup the vm with. logged into root via sudo -i -
root@primero:~/.ssh# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): primero_deployment_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in primero_deployment_key
Your public key has been saved in primero_deployment_key.pub
The key fingerprint is:
SHA256:PFnWn4vCotzqNFi69AywXyjqVX6NZwmC1gwQyuisAG4 root@primero
The key’s randomart image is:
±–[RSA 3072]----+
| o. |
|+ . . |
|+. . o . |
|= = . + . . |
|.E.o =…S o |
|+ .oo=. +o. . . |
|. o.*.+o.=o . . |
| …+ O.+o. . |
|o. o.B… |
±—[SHA256]-----+
created the ssh key - copied the content of the private key into the secrets.yml file.
Still getting the same error

You need to copy the key like this
ssh-copy-id -i localhost
This copies the key to authorized_keys which you can check exists
Then try to ssh to the localhost with
ssh -vv root@primero.pennyappeal.local

So if I just try ssh -vv root@primero.pennyappeal.local it fails and wants a password authentication.
if I specify the ssh-key then it authenticates with no issue : ssh -vv -i primero_deployment_key root@primero.pennyappeal.local
I think it might have something to do with the sshd_config file, but I am not sure.

Just adding my secrets.yml :
primero_secret_key_base: ‘xxxxx’
primero_message_secret: ‘xxxxx’
postgres_password: ‘xxxxx’
devise_secret_key: ‘xxxxx’
devise_jwt_secret_key: ‘xxxxx’
ssh_private_key: |
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtc
-----END OPENSSH PRIVATE KEY-----
i’ve redacted the most of it, just showing the file structure.

Can ansible read authorized_keys? What permissions does it have? You may need to do

chmod og-wx ~/.ssh/authorized_keys

Hi,
root@primero:~# chmod og-wx ~/.ssh/authorized_keys
root@primero:~# ls -lah .ssh/
total 36K
drwx------ 2 root root 4.0K Jul 18 16:35 .
drwx------ 6 root root 4.0K Jul 19 12:42 …
-rw------- 1 root root 733 Jul 18 16:35 authorized_keys
-rw------- 1 root root 12K Jul 18 10:05 .authorized_keys.swp
-rw-r–r-- 1 root root 284 Jul 18 16:28 known_hosts
-rw------- 1 root root 2.6K Jul 18 14:47 primero_deployment_key
-rw-r–r-- 1 root root 566 Jul 18 14:47 primero_deployment_key.pub
root@primero:~# cd /home/chris/v2-deploy/primero/ansible/
root@primero:/home/chris/v2-deploy/primero/ansible# source …/venv/bin/activate
(venv) root@primero:/home/chris/v2-deploy/primero/ansible# ansible-playbook bootstrap.yml
[WARNING]: Could not match supplied host pattern, ignoring: vpc
[WARNING]: Could not match supplied host pattern, ignoring: first_run

PLAY [!vpc:!first_run] ***************************************************************************************************************************************************************************************

TASK [quoin.infrastructure.install_python3 : install Python version 3] ***************************************************************************************************************************************
fatal: [primero.pennyappeal.local]: UNREACHABLE! => changed=false
msg: ‘Failed to connect to the host via ssh: root@primero.pennyappeal.local: Permission denied (publickey,password).’
unreachable: true

PLAY RECAP ***************************************************************************************************************************************************************************************************
primero.pennyappeal.local : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

(venv) root@primero:/home/chris/v2-deploy/primero/ansible#

that needs to be

-rw-r--r--.

so maybe try to

$ chmod 750

the file. The primero deployment key file has the same issue

chmod 750 would give the files execute permissions.
root@primero:~/.ssh# chmod 644 authorized_keys primero_deployment_key
root@primero:~/.ssh# ls -lah
total 36K
drwx------ 2 root root 4.0K Jul 18 16:35 .
drwx------ 6 root root 4.0K Jul 19 12:42 …
-rw-r–r-- 1 root root 733 Jul 18 16:35 authorized_keys
-rw------- 1 root root 12K Jul 18 10:05 .authorized_keys.swp
-rw-r–r-- 1 root root 284 Jul 18 16:28 known_hosts
-rw-r–r-- 1 root root 2.6K Jul 18 14:47 primero_deployment_key
-rw-r–r-- 1 root root 566 Jul 18 14:47 primero_deployment_key.pub
root@primero:~/.ssh# cd /home/chris/v2-deploy/primero/ansible/
root@primero:/home/chris/v2-deploy/primero/ansible# source …/venv/bin/activate
(venv) root@primero:/home/chris/v2-deploy/primero/ansible# ansible-playbook bootstrap.yml
[WARNING]: Could not match supplied host pattern, ignoring: vpc
[WARNING]: Could not match supplied host pattern, ignoring: first_run

PLAY [!vpc:!first_run] ***************************************************************************************************************************************************************************************

TASK [quoin.infrastructure.install_python3 : install Python version 3] ***************************************************************************************************************************************
fatal: [primero.pennyappeal.local]: UNREACHABLE! => changed=false
msg: ‘Failed to connect to the host via ssh: root@primero.pennyappeal.local: Permission denied (publickey,password).’
unreachable: true

PLAY RECAP ***************************************************************************************************************************************************************************************************
primero.pennyappeal.local : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0

Yes , $ chmod 600 ~/.ssh/authorized_keys
Try to remove the swp file then check /etc/ssh/sshd_config and set PasswordAuthentication no then restart the ssh service $ systemctl restart ssh
then try to ssh with debugging turned on and paste the log if it fails

Made the change, already deleted the swap file earlier.
root@primero:~/.ssh# ssh -vv root@primero.pennyappeal.local
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 *
debug2: resolving “primero.pennyappeal.local” port 22
debug1: Connecting to primero.pennyappeal.local [172.16.1.12] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-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_8.9p1 Ubuntu-3
debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3 pat OpenSSH
compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to primero.pennyappeal.local:22 as ‘root’
debug1: load_hostkeys: fopen /root/.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
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,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
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,sntrup761x25519-sha512@openssh.com,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,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: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:qlNU+6Dm+oLs3mJOSRY84pJ20RG/Of1tL9k1adftp/w
debug1: load_hostkeys: fopen /root/.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 ‘primero.pennyappeal.local’ is known and matches the ED25519 host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_ed25519_sk
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: Will attempt key: /root/.ssh/id_dsa
debug2: pubkey_prepare: done
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,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ecdsa_sk
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_ed25519_sk
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Trying private key: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
root@primero.pennyappeal.local: Permission denied (publickey).

Can you also check ssh -vv root@127.0.0.1

root@primero:~/.ssh# ssh -vv root@127.0.0.1
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 *
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa_sk type -1
debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_ed25519_sk type -1
debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-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_8.9p1 Ubuntu-3
debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3 pat OpenSSH
compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 127.0.0.1:22 as ‘root’
debug1: load_hostkeys: fopen /root/.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
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,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
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,sntrup761x25519-sha512@openssh.com,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,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: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:qlNU+6Dm+oLs3mJOSRY84pJ20RG/Of1tL9k1adftp/w
debug1: load_hostkeys: fopen /root/.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: hostkeys_find_by_key_cb: found matching key in ~/.ssh/known_hosts:1
debug1: hostkeys_find_by_key_cb: found matching key in ~/.ssh/known_hosts:2
debug1: hostkeys_find_by_key_hostfile: hostkeys file /root/.ssh/known_hosts2 does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist
The authenticity of host ‘127.0.0.1 (127.0.0.1)’ can’t be established.
ED25519 key fingerprint is SHA256:qlNU+6Dm+oLs3mJOSRY84pJ20RG/Of1tL9k1adftp/w.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:1: [hashed name]
~/.ssh/known_hosts:2: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘127.0.0.1’ (ED25519) to the list of known hosts.
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /root/.ssh/id_rsa
debug1: Will attempt key: /root/.ssh/id_ecdsa
debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
debug1: Will attempt key: /root/.ssh/id_ed25519
debug1: Will attempt key: /root/.ssh/id_ed25519_sk
debug1: Will attempt key: /root/.ssh/id_xmss
debug1: Will attempt key: /root/.ssh/id_dsa
debug2: pubkey_prepare: done
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,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ecdsa_sk
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: Trying private key: /root/.ssh/id_ed25519_sk
debug1: Trying private key: /root/.ssh/id_xmss
debug1: Trying private key: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
root@127.0.0.1: Permission denied (publickey).

Hi,
Do you think it could have something to do with the sshd_config file?