Bright Leopold

i come from the other world,i will go back after the love,the regret,the alive and the dead are over

导航

unix scp命令(两个unix系统传输文件)

1.安装openssh-server模块

sudo apt-get install ssh openssh-server

2.使用命令

  • 将本地文件拷贝到远程

scp 文件名 –用户名@计算机IP或者计算机名称:远程路径

  • 从远程将文件拷回本地

scp –用户名@计算机IP或者计算机名称:文件名 本地路径

命令格式

scp local_file remote_username@remote_ip:remote_folder 
或者 
scp local_file remote_username@remote_ip:remote_file 
或者 
scp local_file remote_ip:remote_folder 
或者 
scp local_file remote_ip:remote_file 

3.有时候会出现Permission denied(验证失败)的问题:

那是因为没有远程系统的文件夹访问权限的问题.

可以使用tmp文件夹避开

使用~/tmp为远程目标文件夹

完整格式: scp file_name remote_name@remote_ip:~/tmp

然后修改tmp文件的名称即可

参考:http://www.linuxidc.com/Linux/2015-11/125214.htm

 

posted on 2018-01-04 17:27  Bright Leopold  阅读(437)  评论(0编辑  收藏  举报