首页 > 系统服务 > 详细

Linux-No.05 scp实现不同电脑间进行文件复制

时间:2014-09-26 19:26:10      阅读:279      评论:0      收藏:0      [点我收藏+]

1、实现上传文件功能

scp -r -P 33030 /usr/local/nginx/logs/access_120_2014-09-26.log

2、实现下载文件功能

 scp -r -P 33030  /opt

3、SSH实现scp命令无需输入密码实现

    1)本地机器先生成公钥

        [root@Client root]# ssh-keygen -b 1024 -t rsa

        Generating public/private rsa key pair.

        Enter file in which to save the key (/root/.ssh/id_rsa):

        Enter passphrase (empty for no passphrase):                <-- 直接输入回车

        Enter same passphrase again:                           <-- 直接输入回车

        Your identification has been saved in /root/.ssh/id_rsa.

        Your public key has been saved in /root/.ssh/id_rsa.pub.

        The key fingerprint is:

        49:9c:8a:8f:bc:19:5e:8c:c0:10:d3:15:60:a3:32:1c root@Client

        这样就会在 用户目录下的.ssh 目录下产生两个文件  id_rsa 和 id_rsa.pub,然后 把 id_rsa.pub的内容复制到 远程机器的 用户目录下 .ssh 目录下的文件authorized_keys中即可。不需要覆盖它,只要粘贴在原有内容下边就行。

    

Linux-No.05 scp实现不同电脑间进行文件复制

原文:http://my.oschina.net/shma1664/blog/318996

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!