windows下用putty上传文件到远程Linux方法

scp

如果可能的话使用scp  比如win端已经安装了Gow等

scp god@192.168.1.105:/home/god/LICENCE C:/
下载文件夹加上 -r

pscp

putty安装目录下,存在可执行文件pscp.exe,用法跟scp命令相似,

win+R 输入 cmd进入命令行,

比如要将本地的LICENCE文件上传到远程计算机192.168.1.105的home/god中,远程主机登陆账号为god,命令如下:

pscp   LICENCE    god@192.168.1.105:/home/god

然后提示输入密码,然后OK

 

psftp

当然,也可以使用putty安装包自带的psftp.exe工具,初级用法跟pscp相同:

pscp LICENCE god@192.168.1.105:/home/god

若是双击运行该psftp.exe,可使用open打开远程主机、cd改变远程目录、lcd改变本地目录、ls查看远程文件列表、put上传文件、get下载文件等命令

例如:open 192.168.220.129开始:

 

 

 

 

 

 

 

 进入有空格的目录必须加双引号

如果需要上传文件夹,在可以在put命令后增加参数 -r ,意思为循环递归。会将本地路径文件夹下的所有文件上传到目标路径下。

psftp> put -r e:/web/ /root/putty
psftp> put -r c:/"program files"/putty/ /root/putty2
local:c:/program files/putty/.bashrc => remote:/root/putty2/.bashrc
local:c:/program files/putty/.pki => remote:/root/putty2/.pki
local:c:/program files/putty/LICENCE => remote:/root/putty2/LICENCE
local:c:/program files/putty/README.txt => remote:/root/putty2/README.txt
local:c:/program files/putty/pageant.exe => remote:/root/putty2/pageant.exe
local:c:/program files/putty/plink.exe => remote:/root/putty2/plink.exe
local:c:/program files/putty/pscp.exe => remote:/root/putty2/pscp.exe
local:c:/program files/putty/psftp.exe => remote:/root/putty2/psftp.exe
local:c:/program files/putty/putty.chm => remote:/root/putty2/putty.chm
local:c:/program files/putty/putty.exe => remote:/root/putty2/putty.exe
local:c:/program files/putty/puttygen.exe => remote:/root/putty2/puttygen.exe
local:c:/program files/putty/website.url => remote:/root/putty2/website.url
psftp>

 

posted @ 2022-07-20 23:47  星火撩原  阅读(1619)  评论(0编辑  收藏  举报