scp的使用

    scp是 secure copy的缩写, scplinux系统下基于ssh登陆进行安全的远程文件拷贝命令。linuxscp命令可以在linux服务器之间复制文件和目录。

1、格式

scp [-124rv][-P port] [[user@]host1:]file1 [...] [[user@]host2:]file2

1,2,3表示使用的ssh协议类型,r为递归复制整个目录,v列出详细

1、复制文件

scp local_file remote_username@remote_ip:remote_folder

如:scp /home//scp.zip root@192.168.0.1:/home/soft

2、复制目录

scp -r local_folder remote_username@remote_ip:remote_folder

scp -r /home/soft/ root@www.mydomain.com:/home/others/

3、关于把(公开,私有)密钥保存在peer pc上来达到免除输入密码的方法,可以参见【2】。

参考

1http://www.cnblogs.com/gergro/archive/2008/06/19/1225959.html

2http://www.cnblogs.com/gergro/archive/2008/06/19/1225959.html

posted @ 2011-09-03 15:55  浪里飞  阅读(276)  评论(0编辑  收藏  举报