Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Permission denied (publickey).?

when I’m trying to connect to server get this error

can you help me?

thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

ssh root@srv.alimd.ir -vvv

OpenSSH_8.8p1, OpenSSL 1.1.1l  24 Aug 2021
debug1: Reading configuration data /home/njfamirm/.ssh/config
debug1: /home/njfamirm/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/njfamirm/.ssh/known_hosts'
debug2: resolving "srv.alimd.ir" port 22
debug3: resolve_host: lookup srv.alimd.ir:22
debug3: ssh_connect_direct: entering
debug1: Connecting to srv.alimd.ir [94.237.24.136] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug1: Connection established.
..
.
.
.
.
.
.
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/njfamirm/.ssh/id_rsa RSA SHA256:nG0n/dYkV6P2wHzjnOXEKe2LjIFWYe9CnZvb7zHljxk
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/njfamirm/.ssh/id_dsa
debug3: no such identity: /home/njfamirm/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/njfamirm/.ssh/id_ecdsa
debug3: no such identity: /home/njfamirm/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/njfamirm/.ssh/id_ecdsa_sk
debug3: no such identity: /home/njfamirm/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /home/njfamirm/.ssh/id_ed25519
debug3: no such identity: /home/njfamirm/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /home/njfamirm/.ssh/id_ed25519_sk
debug3: no such identity: /home/njfamirm/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /home/njfamirm/.ssh/id_xmss
debug3: no such identity: /home/njfamirm/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
root@srv.alimd.ir: Permission denied (publickey).

~/.ssh/config

Host *
    StrictHostKeyChecking ask
    UserKnownHostsFile ~/.ssh/known_hosts
    LogLevel INFO
    ServerAliveInterval 120

>Solution :

Seems your server requires to connect with ssh key only. This file seems missing on your computer :

/home/njfamirm/.ssh/id_dsa

You can create a new one with ssh-keygen, but it can be a problem for the existing server as another key is probably already deployed.

Maybe you changed your computer ?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading