Answer the question
In order to leave comments, you need to log in
How to login with ssh key to the server?
Got a job on the server, no password from ssh.
There is access to whm and cpanel.
I created the rsa 2048 key in whm and entered the
password. The server has the key. I authorized it through the panel, everything is ok. Named it as standard id_rsa. Disabled password authentication.
I do ssh-keygen -t rsa in my ubuntu console and
enter the same password. I also name the key id_rsa
Then I do
ssh-copy-id -i ~/.ssh/id_rsa.pub -p port [email protected]
Writes me
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
It's just that I can't log in via ssh -p port [email protected] either.
Writes the same. How to enter by key?
Answer the question
In order to leave comments, you need to log in
Er... I don't even know where to start...
Why do the keys have to match? They are randomly generated. The password is only needed to decrypt the key.
When you generate a key, a pair is generated - public and private. You must add the public one to the server in ~/.ssh/authorized_keys
If you generated it with the standard name id_rsa, then the public one will be called id_rsa.pub - the contents of this file must be added to ~/.ssh/authorized_keys
And the id_rsa file itself must be in ~ /.ssh of the machine you are logging in from.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question