演示工具: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