1

I was trying to copy a key id for password-less SSH access, however it seems that the password authentification is no. I am not sure how to change that.

Here is the original code:

ssh-copy-id xxxx@xxxx

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/xxxx/.ssh/id_rsa.pub"

/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

xxxx@xxxx: Permission denied (publickey).

Falio
  • 45
  • 2
  • 5

1 Answers1

0

You must briefly enable password access in order to use ssh-copy-id, then disable it again.

  • Reminder: after enabling/disabling password access, you must restart sshd so it reloads the new configuration.

Example:

server$ sudo nano /etc/ssh/sshd_config        # Set "PasswordAuthentication" to "yes"
server$ sudo systemctl restart sshd.service   # Restart sshd

client$ ssh-copy-id me@123.456.789.012 # Transmit your key client$ ssh me@123.456.789.012 # Test login using key

server$ sudo nano /etc/ssh/sshd_config # Set "PasswordAuthentication" to "no" server$ sudo systemctl restart sshd.service # Restart sshd

alelom
  • 105
user535733
  • 68,493