I've just set up OpenSSH on my system (Ubuntu 18.04 LTS), and generated the key using ssh-keygen. When prompted for password, I set it to just one character to test, but when I try to copy the public key onto the server, it keeps saying:

ssh-copy-id user@ip

/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: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

user@ip's password:

Permission denied, please try again.

user@ip's password:

Permission denied, please try again.

user@ip's password:

user@ip's: Permission denied (publickey,password).

The ip above was obtained from ipchicken. Port forwarding on 22 is turned on in my router, but another device is also configured to that. I have a static IP with different devices configured to it. Is it possible that this is interfering with my connection? If not, how do I resolve this issue?

1 Answer 1


You just generated a new key. You can not use that key to connect to a remote host since the public key is not available on it yet. To copy the key, you will have to use your user's password on that host (unless it has another of your public SSH keys already, which I in this case doubt), not the password for the key.

  • I have tried using my password on that host as well, but it gives the same error message Jun 16, 2018 at 7:41
  • @megadarkfriend Then you are using the wrong password, or the host is for some reason blocking you from logging in with SSH. Are you normally able to log in with SSH on that host?
    – Kusalananda
    Jun 16, 2018 at 7:50
  • This is the first time I've tried logging in with SSH on this. We have a static IP set up with different devices connected to it, could that potentially be an issue? Jun 16, 2018 at 8:06
  • @megadarkfriend The issue is that you don't know your login password on that server. Contact the admin of the server to make them issue you a password. If you are the admin, log in as root and set your password.
    – Kusalananda
    Jun 16, 2018 at 8:15

You must log in to answer this question.

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