分类: LINUX
2009-01-17 09:14:31
C:>pscp可以看出 PSCP 的使用是很简单的,把常用的几个选项说一下:
PuTTY Secure Copy client
Release 0.58
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 authentication
-batch disable all interactive prompts
-unsafe allow server-side wildcards (DANGEROUS)
-sftp force use of SFTP protocol
-scp force use of SCP protocol
C:>
pscp c:autoexec.bat foobarserver:backup/就把本地的 c:autoexec.bat 复制到了主机 demo-server 上的用户 taylor 所在的主目录下的 backup 子目录中(这个路径可能是 /home/taylor/backup
pscp c:pathfoo.txt 192.168.6.200:/tmp把本地的 C:pathfoo.txt 复制到主机 192.168.6.200 的 /tmp 目录下,但是以主机上的用户 taylor 的权限执行
pscp c:pathfoo.txt taylor@192.168.6.200:/tmp或者是
pscp -l taylor c:pathfoo.txt 192.168.6.200:/tmp把本地的 C:pathfoo.txt 传送到主机 192.168.6.200 的 /tmp 目录下,但是主机的 SSH 端口是 3122
pscp -P 3122 c:pathfoo.txt 192.168.6.200:/tmp把本地的 C:pathfoo.txt 复制到主机 192.168.6.200 的用户 taylor 的主目录下
pscp c:pathfoo.txt taylor@192.168.6.200:.把主机 192.168.6.200 上的用户 taylor 主目录下的所有 *.tgz 文件拷贝到本地的 c:backup 目录中,如果 SSH 版本是 SSH v1,那这个命令就会出错。
pscp taylor@192.168.6.200:*.tgz c:backup
C:>psftp -h用法与 PSCP 大同小异,虽然有个 -load 选项,其实这个没啥用,后面用主机名的时候,与 PSCP 一样直接用上会话名称就可以了。
PuTTY Secure File Transfer (SFTP) client
Release 0.58
Usage: psftp [options] [user@]host
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-b file use specified batchfile
-bc output batchfile commands
-be don't stop batchfile processing if errors
-v show verbose messages
-load sessname Load settings from saved session
-l user connect with specified username
-P port connect to specified port
-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 authentication
-batch disable all interactive prompts
C:>