本地windows机器和远程Linux服务器之间文件传输 -- Xshell 使用sftp 上传下载文件
程序员文章站
2022-06-02 13:56:15
...
一、登录远程Linux服务器:
[c:\~]$ sftp root@192.168.233.136
1.1、回车进行认证:
1.2、登录成功:
二、上传文件到服务器:
2.1上传操作
拖拽待上传文件到当前窗口即可
另一种方式–使用命令:
sftp:/root> lcd E:\安装包\linux下\
Local directory is now E:\安装包\linux下\
sftp:/root> put jdk-7u80-linux-x64.tar.gz
Uploading jdk-7u80-linux-x64.tar.gz to remote:/root/jdk-7u80-linux-x64.tar.gz
sftp: sent 146 MB in 2.72 seconds
*注意:
界面可能会乱码,调一下界面显示语言的编码即可
因为我的windows是windows10中文版,默认编码是gbk,我把编码改成gbk就可以了
设置编码是这个按钮:*
三、从服务器下载文件到本地机器
切换到保存服务器下载文件的目录下再进行下载文件操作
sftp:/root> lcd D:\Temp
Local directory is now D:\Temp
sftp:/root> lpwd
Local directory is D:\Temp
sftp:/root> get apache-tomcat-8.0.47.tar.gz
Fetching /root/apache-tomcat-8.0.47.tar.gz to apache-tomcat-8.0.47.tar.gz
sftp: received 8.93 MB in 0.34 seconds
附:
参考命令:
1、
[c:\~]$ sftp
NAME
sftp - connects to a host to transfer files securely.
SYNOPSYS
sftp [aaa@qq.com]host [port]
OPTIONS
user Indicates the user's login name.
host Indicates the name, alias, or Internet address of the
remote host.
port Indicates a port number (address of an application).
If the port is not specified, the default ssh port
(22) is used.
2、
sftp:/root> help
bye finish your SFTP session
cd change your remote working directory
clear clear screen
exit finish your SFTP session
explore explore your local directory
get download a file from the server to your local machine
help give help
lcd change and/or print local working directory
lls list contents of a local directory
lpwd print your local working directory
ls list contents of a remote directory
mkdir create a directory on the remote server
mv move or rename a file on the remote server
put upload a file from your local machine to the server
pwd print your remote working directory
quit finish your SFTP session
rename move or rename a file on the remote server
rm delete a file
rmdir remove a directory on the remote server
上一篇: 2016最新SEO网站排名技巧 完整的SEO快速排名点击算法流程
下一篇: 智能指针