Score:1

Permission denied (publickey).?

jp flag

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

can you help me?

thanks!

ssh [email protected] -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.
[email protected]: Permission denied (publickey).

~/.ssh/config

Host *
    StrictHostKeyChecking ask
    UserKnownHostsFile ~/.ssh/known_hosts
    LogLevel INFO
    ServerAliveInterval 120
hr flag
You appear to be trying to use *your* RSA private key (`/home/njfamirm/.ssh/id_rsa`) to authenticate as `root` on the server - are you sure it's set up to allow that (i.e. your public key is in *root*'s authorized keys file on the target host)?
John Hanley avatar
in flag
1) Most public servers forbit logins as the user root. 2) You do not have an SSH key for this server stored in ~/.ssh. You will need to possess the private key for that server to login. You do not have any keys in the default directory.
Score:0
de flag
ob2

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 ?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.