ssh-copy-id
时间: 2023-08-30 12:07:33 浏览: 214
ssh-copy-id是一个用于将本地公钥复制到远程主机的命令。它可以将本机的公钥复制到远程机器的authorized_keys文件中,并设置合适的权限。\[1\]\[2\]\[3\]使用ssh-copy-id命令时,可以通过-i选项指定认证文件(公钥),也可以使用默认的~/.ssh/identity.pub作为默认公钥。\[2\]\[3\]在运行ssh-copy-id命令时,如果多次运行,它不会检查重复,会在远程主机中多次写入authorized_keys文件。\[3\]使用示例可以是:ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host,其中remote-host是远程主机的地址。\[4\]需要注意的是,ssh-copy-id将公钥写入远程机器的~/.ssh/authorized_keys文件中。\[4\]如果在使用选项-i时没有传入值,或者~/.ssh/identity.pub文件不可访问(不存在),ssh-copy-id会显示错误信息。\[5\]
#### 引用[.reference_title]
- *1* *4* *5* [ssh-copy-id命令的介绍,使免密更方便](https://blog.csdn.net/qq_43688472/article/details/109625590)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Linux 命令(210)—— ssh-copy-id 命令](https://blog.csdn.net/K346K346/article/details/128178191)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [ssh-copy-id命令](https://blog.csdn.net/shaoming314/article/details/122640975)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文