使用ssh的pscp命令 对Linux服务器的文件上传下载

演示工具:putty

操作系统:window;Linux

首先需要下载putty安装包。

下载地址:https://the.earth.li/~sgtatham/putty/0.70/w64/putty-64bit-0.70-installer.msi

 

上传文件到Linux服务器命令:

pscp a.run root@198.168.1.29:/website/a.run

上传文件夹到Linux服务器命令:

pscp -r dir/ root@198.168.1.29:/website/dir/

文件夹从Linux下载(若未指定路径则下载到当前路径下):

pscp -r root@192.168.1.168:/forLove/ forLove/

文件从Linux下载(若未指定路径则下载到当前路径下):

pscp root@192.168.1.168:/forLove.run forLove.run

补充:

文件通过1122端口上传到服务器命令,下载命令同理:

pscp -P 1122 a.run root@198.168.1.29:/website/a.run

pscp有一些常用参数,可以通过直接输入pscp查看,如下:

PuTTY Secure Copy client
Release 0.71
Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -p        preserve file attributes
  -q        quiet, don't show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -P port   connect to specified port
  -l user   connect with specified username
  -pw passw login with specified password
  -1 -2     force use of particular SSH protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for user authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -hostkey aa:bb:cc:...
            manually specify a host key (may be repeated)
  -batch    disable all interactive prompts
  -no-sanitise-stderr  don't strip control chars from standard error
  -proxycmd command
            use 'command' as local proxy
  -unsafe   allow server-side wildcards (DANGEROUS)
  -sftp     force use of SFTP protocol
  -scp      force use of SCP protocol
  -sshlog file
  -sshrawlog file
            log protocol details to a file

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冰夏之夜影

赠人玫瑰,手留余香

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值