回到顶部

阅读目录

Linux scp 无密码复制文件

目的:本地服务器(local)复制文件到远程服务器(remote)

本地服务器:local

远程服务器:remote (192.168.1.254)

1. 在 local 上运行 ssh-keygen -t rsa 在 /root/.ssh 下生成 id_rsa 和 id_rsa.pub 两个文件

2. 在 /root/.ssh 下复制备份一份 id_rsa.pub 命名为 id_rsa.pub.L

3. 在 local 上运行 ssh-keygen -t rsa 在 /root/.ssh 下生成 id_rsa 和 id_rsa.pub 两个文件

4. 使用 rz 把 local 的 id_rsa.pub.L 上传到  remote 的 /root/.ssh 下

5. 使用 cat id_rsa.pub.L >> authorized_keys 把 local 的 公钥 写入到 authorized_keys 文件

6. 然后在 local 上就可以无密码使用 scp 复制文件到 remote 了(scp <file> root@192.168.1.254:/home/downloads)

 


^_^
请喝咖啡 ×

文章部分资料可能来源于网络,如有侵权请告知删除。谢谢!

前一篇: CKEditor 禁止 img 标签自动添加 style 样式 - 禁止自动设置 width 和 height
下一篇: Fiddler Modifying a Request or Response
captcha