0

I can't access my dedicated server via ssh

this's the result of "ssh -v user@server-ip" command line:

OpenSSH_6.9p1, LibreSSL 2.1.7
debug1: Reading configuration data /Users/mac/.ssh/config
debug1: /Users/mac/.ssh/config line 13: Applying options for centos
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to 178.238.227.44 [178.238.227.44] port 22.
debug1: Connection established.
debug1: identity file /Users/mac/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mac/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to 178.238.227.44:22 as 'pacman'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:iOB30QCPqAng85e+Bff5a8jwIlPfL9tTb7TPucQE8/8
debug1: Host '178.238.227.44' is known and matches the RSA host key.
debug1: Found key in /Users/mac/.ssh/known_hosts:9
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,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/mac/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /Users/mac/.ssh/id_dsa
debug1: Trying private key: /Users/mac/.ssh/id_ecdsa
debug1: Trying private key: /Users/mac/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

this happened when I configured the ssh connection with public_key i created the authorized_keys file and copy my ssh key inside it.

can i fix this or i need to contact the server profider ?

2
  • 1
    You need to specify the identify file with -i so the command should be ssh -i /path/to/key user@ip
    – JayMcTee
    Jan 8, 2016 at 13:46
  • i did this but i got same error : ssh -i .ssh/id_rsa.pub user@ip Jan 8, 2016 at 15:39

2 Answers 2

1

The two I always check on the server

sudo chown <username:username> /home/<username>/.ssh/authorized_keys
sudo chmod 0400 /home/<username>/.ssh/authorized_keys
1
  • 1
    I would also make sure that ~/.ssh on the server has no more then 0755 in permissions bits and correct ownership.
    – Tomek
    Apr 10, 2019 at 6:41
-1

You can try to use -o PreferredAuthentications=password if you don't disable password based auth.

ssh -o PreferredAuthentications=password user@server-ip

Then you can debug rsa auth.

1
  • This would not work as server is not offering this type of authentication.
    – Tomek
    Apr 10, 2019 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .