Loading... ## 文件复制 ``` scp -P 22 /path/to/source/file username@remote_host:/path/to/destination/directory ``` <div class="tip inlineBlock info"> 默认端口22,可以不写 -P 22,另外file支持通配符如:*.txt </div> ## 免密复制 生成 SSH 钥匙对 ``` ssh-keygen -t rsa ``` 将公钥复制到远程服务器的 ~/.ssh/authorized_keys 文件中 ``` ssh-copy-id -p 22 username@remote_host ``` <div class="tip inlineBlock info"> 生成密钥的时候会询问保存位置、密钥等,直接回车也可以 </div> 最后修改:2024 年 05 月 07 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 1 如果觉得我的文章对你有用,请随意赞赏