Click the new session icon on the toolbar, select SFTP as the protocol in the pop-up new session window, enter the host name or ip address, port number 22, click connect, enter the user name and password to complete the connection creation.
Local/remote directory setting: When creating a new session, set the local and remote directories for file upload and download in SFTP in the figure below. You can also use the cd command to switch directories in the terminal.
Chinese garbled characters are set in the terminal
You can also directly connect to the remote server through the sftp <ip> command.
According to the pop-up prompt of Xshell, enter the login user name and password.
You can also directly provide the login user in the input command: sftp <user>@<ip>, so that Xshell will directly pop up a window to prompt you to enter the corresponding password to log in.
sftp common commands:
pwd
Andlpwd
,pwd
is to view the current directory path of the remote server,lpwd
is to view the current directory path of the local computercd
Andlcd
,cd
is to switch the directory of the remote server,lcd
is to switch the directory of the local computerls
Andlls
,ls
it is to viewsftp
the file information of the current directory of the server,lls
and to view the file information of the current directory of the local computerput
Andget
, put is to upload files (from local computer to remote server), get is to download files (from remote server to local computer)exit/quit
,quit