ssh-copy-id
时间: 2023-10-16 11:10:20 浏览: 37
ssh-copy-id is a command-line utility that is used to copy a user's public key to a remote host's authorized_keys file. This allows the user to login to the remote host without having to enter a password, as the private key is used for authentication instead.
The syntax of the command is as follows:
ssh-copy-id [options] [user@]hostname
Options:
- -i: Specify the path to the public key file to be copied (default is ~/.ssh/id_rsa.pub)
- -p: Specify the port number to connect to on the remote host (default is 22)
- -o: Specify additional ssh options to pass to the ssh command
Example usage:
ssh-copy-id user@remote-host
This command will prompt the user for their password on the remote host, then copy their public key to the authorized_keys file. After this, the user can log in to the remote host without a password.