Linux和windows间传递文件

测试环境:

CentOS 8.5

Windows 10

特殊说明:

CentOS安装的是8.1,然后升级到8.5。选择带GUI的服务器。

在CentOS上安装SSH,即可实现Linux和Windows间互相传递文件。

CentOS 8.1默认自带SSH软件包,假如没有安装请按下面的步骤安装:

su root

yum install openssh-server

yum install openssh-clients

启动服务

systemctl start sshd

上面没有实际测试!

putty

Download PuTTY: latest release (0.76) (greenend.org.uk)icon-default.png?t=LA92https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html下载putty.zip,这里包含所有的exe。不用单独下。

从windows向linux传递文件使用pscp.exe

pscp d:\test.txt work1@1.1.1.1:/home/work1 拷贝文件

pscp -r d:\test work1@1.1.1.1:/home/work1 拷贝文件夹

将work1为访问CentOS的用户名,1.1.1.1为目标机的IP地址

psftp命令能实现windows和linux间互相传递文件

psftp.exe

open 1.1.1.1

输入用户

输入密码

get -r /home/work1/test 将文件夹/home/work1/test下载到本地

get /home/work1/test.txt 将/home/work1/test.txt文件下载到本地

put -r d:/test/ /home/work1/test 将d:\test上传到/home/work1下

put d:/test.txt /home/work1 将d:\test.txt文件上传到/home/work1下

psftp使用说明

! 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 files 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 files on the remote server
reput continue uploading files
rm delete files on the remote server
rmdir remove directories on the remote server

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值