2

In every process SSH return Permission denied (publickey).

ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 4 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Permission denied (publickey).


ssh [email protected]
Permission denied (publickey).

When i try using -vvv then return

debug1: Trying private key: /home/leo/.ssh/id_dsa
debug3: no such identity: /home/leo/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/leo/.ssh/id_ecdsa
debug3: no such identity: /home/leo/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/leo/.ssh/id_ed25519
debug3: no such identity: /home/leo/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

How to stop SSH Permission denied (publickey) and connect to host server?

1 Answer 1

3

It looks like on your server you only can login with a key, not with password.

If your public key on the server site is added to /root/.ssh/authorized_keys then you should be able to login with ssh [email protected] -i /path/to/key

If you don't have a key, you could follow this steps:

  1. on your client run ssh-keygen, by default the key is created ath ~/.ssh/id_rsa
  2. There also is a id_rsa.pub created. Copy that line in id_rsa.pub and add it on the server to /root/.ssh/authorized_keys
  3. Login to your server with ssh [email protected] -i ~/.ssh/id_rsa
7
  • copy id_rsa or id_rsa.pub which file copy on the server please specify me
    – ketty
    Commented Nov 21, 2017 at 10:01
  • I changed my answer at number 2, I had a typo. You have to copy the line from id_rsa.pub to the /root/.ssh/authorized_keys of your server.
    – chloesoe
    Commented Nov 21, 2017 at 10:44
  • is there any best way to write this file on server console? cause i can not copy paste
    – ketty
    Commented Nov 21, 2017 at 11:10
  • how do you connect to your server? Actually you could copy the file with scp (but since you can't login with ssh, this would not work). You could copy your public key on an ftp-server and download it from the server.
    – chloesoe
    Commented Nov 21, 2017 at 11:57
  • i have no ssh so can not able to create ftp-server
    – ketty
    Commented Nov 21, 2017 at 12:03

You must log in to answer this question.

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