本地与服务器之间传输文件的几种方法

1.使用终端模拟器-Xshell

下载链接:https://xshell.en.softonic.com/

通过会话连接服务器后,点击:‘文件-传输-ZMODEM-发送或接收’

 

2. 使用SSH客户端软件-Bitvise SSH Client

下载链接:http://www.canadiancontent.net/tech/download/Bitvise_SSH_Client.html

通过会话连接服务器后,点击upload queue,完成上传

 

3. 使用scp命令

用于linux之间复制文件和目录,scp是secure copy的缩写

写法:

  • 从本地复制到远程

移动文件

scp local_file remote_username@remote_ip:remote_folder

例如:scp /home/a/1.py root@www.xxx.com:/home/b

这样就完成了从本地a文件夹中把1.py文件复制到了地址为 root@www.xxx.com的b文件夹中

移动文件夹

scp -r local_folder remote_username@remote_ip:remote_folder

  • 从远程复制到本地

只要将从本地复制到远程命令的两个位置对调即可

scp remote_username@remote_ip:remote_folder local_file

scp -r remote_username@remote_ip:remote_folder local_folder

注:使用scp命令时需要注意,如果远程服务器防火墙为scp设置了指定端口,还需要使用-p参数设置命令的端口

例如scp 命令端口为1122,则命令为

scp -p 1122 local_file remote_username@remote_ip:remote_folder

 

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值