pscp+psftp+putty的使用

1:putty的使用

在上面按照提示输入想要连接的主机名或者IP地址,Saved Session(保存会话),随便输入,可以直接复制上面的IP地址便于记忆,点击Save保存输入的信息,点击Open之后可以使用用户名+密码登陆了

设置保持会话连接,让其会话不过期

点击Category->Connection,看到Seconds between keepalives(0 to turn off)【 0 】

这里说的就是设置保持生命期的时间,以秒为单位,我们设置为20,表示每隔20秒就会putty就会向远程主机发送空的数据包保持连接

2:pscp的使用

需要将命令行目录改变到pscp.exe文件所在的目录,如果需要在哪里都可以使用pscp,则可以将pscp.exe放到C:\Windows\System32>目录下即可

使用pscp查看远程主机的文件目录

pscp的命令使用格式

PuTTY Secure Copy client
Release 0.65
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
  -unsafe   allow server-side wildcards (DANGEROUS)
  -sftp     force use of SFTP protocol
  -scp      force use of SCP protocol

命令

使用 pscp [options] -ls [user@]host:filespec

pscp -pw 123456 -ls root@123.57.22.75:/

可以查看123.57.22.75下的/(跟目录)目录的文件夹信息

传输文件

传输单个文件F:/word.txt到主机123.57.22.75下的/home目录

pscp -l root -pw 123456 F:/word.txt 123.57.22.75:/home

传输多个文件可以使用星号(*)表示传输多个文件例如

pscp -l root -pw 123456 F:\* 123.57.22.75:/home

表示传输本地windows系统的F盘下的所有文件都传输到123.57.22.75下的/home目录

3 psftp的使用

需要将命令行目录改变到pscp.exe文件所在的目录,如果需要在哪里都可以使用pscp,则可以将pscp.exe放到C:\Windows\System32>目录下即可

1:登录

I:在命令行下输入psftp就可以进入psftp了,之后输入help就可以查看psftp的命令

II:在命令行下输入psftp -l root -pw 123456 123.57.22.75 就可以完成登录到123.57.22.75了

命令

!      run a local command
bye    finish your SFTP session
cd     change your remote working directory
chmod  change file permissions and modes
close  finish your SFTP session but do not quit PSFTP
del    delete files on the remote server
dir    list remote files
exit   finish your SFTP session
get    download a file from the server to your local machine
help   give help
lcd    change local working directory
lpwd   print local working directory
ls     list remote files
mget   download multiple files at once
mkdir  create directories on the remote server
mput   upload multiple files at once
mv     move or rename file(s) on the remote server
open   connect to a host
put    upload a file from your local machine to the server
pwd    print your remote working directory
quit   finish your SFTP session
reget  continue downloading files
ren    move or rename file(s) on the remote server
reput  continue uploading files
rm     delete files on the remote server
rmdir  remove directories on the remote server

上传下载文件

可以上传下载过个文件,具体使用help查看psftp的命令,记住help需要进入到psftp才可以查看到psftp的命令







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值