Done!

How to copy public key from local machine to remote server or droplet with different port?


ssh-copy-id -p port_number user@hostname 

Here's how it works:

  1. Replace 'port_number' with the port number you want to use.
  2. Replace 'user' user with the username of the remote account.
  3. Replace 'hostname' with the hostname or IP address of the remote server.

For e.g

ssh-copy-id -p 1234 [email protected]