How to use ssh on cpanel server?

1

I want to entry to my cpanel server, but I can't do it. This is what I did. I am going to the login page of my server on cpanel and I got in. Then:

Security -> SSH Access -> Manage SSH Key -> Generate a New Key -> Back -> Public Keys -> Manage -> Authorization -> Back

After that:

I download the private key and I copy in the .ssh (in my local machine) directory and finally I tried to get in using this command:

ssh <usernameserver>@<serverip>

but... I get a reject connection, using ssh -vvv I get this:

penSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "<ipserver>" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <ipserver> [<ipserver>] port 22.
debug1: Connection established.
debug1: identity file /home/<userlocalmachine>/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/<userlocalmachine>/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
ssh_exchange_identification: read: Connection reset by peer

what did I wrong?

My OS is ubuntu 16.04

ILoveTheDoggos

Posted 2018-08-17T22:25:30.570

Reputation: 11

Question was closed 2018-08-26T22:30:15.950

Did you mean to say you downloaded the private, not public, key? You need the private key on your local machine. – tanner – 2018-08-17T22:57:06.167

@TannerFilip no, sorry I edited the question your right I have the private key on my local machine – ILoveTheDoggos – 2018-08-18T00:50:33.353

Answers

0

ssh_exchange_identification: read: Connection reset by peer

This essentially means that the remote server accepted the TCP connection from the client, then immediately closed it. No data exchange has taken place yet. The server didn't send its host key to the client, and the client hasn't tried to authenticate yet.

In particular, "Connection reset" means this is an "abnormal" close. I.e., the ssh server process handling the connection crashed or exited without closing the connection in the normal way. Alternately, a connection reset can also be caused by a firewall which is blocking connection requests.

The explanation is likely to be one of these:

  1. The remote ssh server program is configured not to accept connections from your system
  2. The remote ssh server program is malfunctioning
  3. Something is wrong with the remote server, e.g. it's out of memory
  4. Some router or firewall is interfering with these connection attempts

To fully troubleshoot this, you'd have to get into the server to figure out why the ssh server program is dropping these connections. I don't know anything about cpanel, but the ssh server may be logging error messages to syslog which might help to understand what is happening.

Kenster

Posted 2018-08-17T22:25:30.570

Reputation: 5 474

Mmm the problem is I'm not root user, so I don't have the permission – ILoveTheDoggos – 2018-08-18T18:36:41.657

@ILoveTheDoggos Not sure what you mean. The remote ssh server is closing the connection before it knows who you're trying to log in as. – Kenster – 2018-08-18T19:05:14.717

where should I see the logs? on my local computer or the sever because on the server I don't have the permission, that it what I tried to say – ILoveTheDoggos – 2018-08-18T19:22:48.167