To use
ssh-copy-id
with an OpenSSH server listening on a different port, specify the port number using the -p
option followed by the port number. For example:ssh-copy-id -p <port_number> user@hostname
Here, port_number
is the number of the port on which the OpenSSH server is listening, user
is the username for the account on the server, and hostname
is the hostname or IP address of the server.