Use SecureCRT to transfer files between Linux and Windows
SecureCRT is an SSH client software that provides both terminal simulators and file transfer functions. It is much more convenient than ftp commands, and the server no longer needs to enable the FTP service. Rz, sz is a command line tool for ZModem file transmission in Linux/Unix and Windows.
Windows must support the ZModem telnet/ssh client, and SecureCRT can be used to log on to Unix/Linux Hosts (either telnet or ssh ).
To upload a file, you only need to enter the command "rz" in the shell terminal simulator to select the file on the local disk from the pop-up dialog box and use Zmodem to upload the file to the server. To download a file, you only need to enter the command "sz file name" in the shell terminal simulator to download the file to "path/SecureCRT/download/" or (C: \ Users \ Administrator \ Downloads) directory. You can use "File Transfer" to modify the default upload and download paths. Set the default directory: options --> session options --> file transfer.
Note: options --> global options --> terminal, you can set the copy and paste of the mouse.
To change the background color and file name color of the SecureCRT terminal, click "option"-"session option" on the menu bar ", in the "terminal"-"simulation" category, select "ANSI color" and "select a backup keyboard simulation-Linux" in the right window ".
This section summarizes the three methods for transferring files from SecureCRT.
1. scp
Scp can copy files between two linux Hosts
Scp [-1246 BCpqrv] [-c cipher] [-F ssh_config] [-I identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user @] host1:] file1 [...] [[user @] host2:] file2
Scp-P port user @ serverip:/home/user/filename
The above port uses uppercase P as the parameter, and port user as the ssh user serverip as the remote server ip address or domain name, /home/user/filename is the name of the remote server/home/user/filename is the name of the Local Service server. This command is used to copy the remote filename to the local directory.
For example, upload the file to the Management Server [root @ localhost ~] # Scp./load. sh yinliu@59.53.86.118
* Copy a file:
* Command format:
Scp local_file remote_username @ remote_ip: remote_folder
Or
Scp local_file remote_username @ remote_ip: remote_file
Or
Scp local_file remote_ip: remote_folder
Or
Scp local_file remote_ip: the username is specified for the remote_file, And the password is required after the command is executed. Only the remote directory is specified for the 1st files, the file name remains the same, and the file name is specified for the 2nd files;
No user name is specified for the 3 and 4 commands. After the command is executed, enter the user name and password. Only the remote directory is specified for the 3rd commands. The file name remains the same and the file name is specified for the 4th commands;
* Copy directory:
* Command format:
Scp-r local_folder remote_username @ remote_ip: remote_folder
Or
Scp-r local_folder remote_ip: remote_folder
1st user names are specified, and the password needs to be entered after the command is executed;
2nd user names are not specified. After the command is executed, enter the user name and password;
* Routine:
Scp-r/home/space/music/root@www.bkjia.com:/home/root/others/
Scp-r/home/space/music/www.bkjia.com:/home/root/others/
The above Command copies the local music directory to the remote others directory, that is, there is a remote ../others/music/directory after the copy.
======
Copy from remote to local
======
From remote to local, you only need to replace the last two parameters of the local command to remote;
For example:
Scp root@www.me.com:/home/root/others/music/home/space/music/ithers
Scp-r www.bkjia.com:/home/root/others // home/space/music/
Scp is easy to use, but it cannot list remote directories or change directories.
2. ZMODEM file send/recv
Rz: to upload a file, you only need to enter the command "rz" in the shell terminal simulator to select the file on the local disk from the pop-up dialog box and use Zmodem to upload the file to the server, for example, upload an rsyncd. conf file to the server ):
[Root @ localhost ~] # Rz
Rz waiting to receive.
Zmodem transmission is starting. Press Ctrl + C to cancel.
Transmitting rsyncd. conf...
100% 715 bytes 715 bytes/s 00:00:01 0 Error
Sz: to download the file, just enter the command "sz file name" in the shell terminal simulator, you can use Zmodem to download the file to the "path/SecureCRT-5.1.3/download/" directory, for example, download the rsyncd in the current directory of the server. conf file to local ):
[Root @ localhost ~] # Sz rsyncd. conf
Rz
Zmodem transmission is starting. Press Ctrl + C to cancel.
Transmitting rsyncd. conf...
100% 715 bytes 715 bytes/s 00:00:01 0 Error
3. sftp
Securecrt press ALT + P to start a new session for ftp operations.
Enter the "help" command to display all commands provided by the FTP.
Pwd: query the directory of the linux host (that is, the remote host directory)
Lpwd: query the local directory (generally refers to the directory of files uploaded by windows: we can view the "session option" in the "option" drop-down box. 2: we know that the local upload directory is: D: /My Documents)
Ls: query the files in the directory of the current linux host.
Lls: queries the files in the current local upload directory.
LCD: change the path of the local upload directory
Cd: Change the remote upload directory
Get: downloads files from the remote directory to the local directory.
Put: upload files in the local directory to the remote host (linux)
Quit: disconnect FTP
Two-way communication between Windows 7 and Linux using SecureCRT and file transfer solution
How to Use SecureCRT6.6.2 to log on to Ubuntu through SSH
SecureCRT connects to Ubuntu
Ubuntu 12.04 + Virtual Machine VMware 9 + Secure CRT + EditPlus local C ++ Development Environment setup
This article permanently updates the link address: