File Transfer between Local windows Machine and Remote Linux Server -- Xshell uploads and downloads files using sftp

Keywords: sftp Linux JDK Apache

1. Log on to a remote Linux server:

[c:\~]$ sftp root@192.168.233.136

1.1. Enter for certification:

1.2. The login was successful:

Upload files to server:
2.1 Upload Operation
Drag and drop the file to the current window.


Another way - using commands:

sftp:/root> lcd E:\Installation package\linux lower\
Local directory is now E:\Installation package\linux lower\

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

* Note:
The interface may be scrambled. Just adjust the code of the interface display language.
Because my windows is the Chinese version of windows 10 and the default encoding is gbk, I can change the encoding to gbk.
Setting the code is this button:*

Download files from server to local machine
Switch to the directory where the server downloads files and download the files.

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

Attachment:
Reference command:
1,

[c:\~]$ sftp
NAME
    sftp - connects to a host to transfer files securely.

SYNOPSYS
    sftp [user@]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

Posted by growler123 on Wed, 06 Feb 2019 19:21:17 -0800