A linux command per day (26): upload and download with SecureCRT

When using SSH to manage a Linux server, it is often necessary to exchange files between remote and local. It is undoubtedly the most convenient to directly use the upload and download function that comes with SecureCRT. The file transfer protocols under SecureCRT include ASCII, Xmodem, and Zmodem.
File Transfer Protocol:
File transfer is the main form of data exchange. When transferring files, we need to establish a unified transfer protocol between the two computers so that the files can be correctly identified and transferred. This agreement includes the identification of the file, the start and end time of transmission, the judgment and correction of errors and so on. Common transfer protocols are as follows:
ASCII: This is the fastest transfer protocol, but can only transfer text files.
Xmodem: This ancient transmission protocol is slow, but due to the CRC error detection method, the transmission accuracy can be as high as 99.6%.
Ymodem: This is an improved version of Xmodem, which uses 1024-bit segment transmission, which is faster than Xmodem
Zmodem: Zmodem uses a streaming (streaming) transmission method, which has a faster transmission speed, and also has the ability to automatically change the segment size and Breakpoint resume, fast error detection and other functions. This is the most popular file transfer protocol out there. #p#Page title#e#
In addition to the above, there are also protocols such as Imodem, Jmodem, Bimodem, Kermit, Lynx, etc. Since they are not supported by most manufacturers, they are omitted here.

SecureCRT can use the zmodem protocol under linux to transfer files quickly, which is very convenient to use. Specific steps:

1. Before uploading and downloading using SecureCRT, you need to install lrzsz on the server:

1. Download lrzsz-0.12.20.tar.gz from the following address

http://down1.chinaunix.net/distfiles/lrzsz-0.12.20.tar.gz

2. Check the INSTALL document inside to understand the installation parameter description and details

3. Unzip the file

tar zxvf lrzsz-0.12.20.tar.gz

4. Enter the directory #p#page title#e#

cd lrzsz-0.12.20

5. ./configure --prefix=/usr/local/lrzsz

6, make

7, make install

8, establish soft links

#cd /usr/bin

#ln -s /usr/local/lrzsz/bin/lrz rz

#ln -s /usr/ local/lrzsz/bin/lsz sz

9. Test

Run rz to pop up the SecureCRT upload window, use SecureCRT to upload and download files.



#p#Pagination title#e# II. To set the default directory for SecureCRT upload and download, just go to

options->session options->Terminal->Xmodem/Zmodem. Set the upload and download directory
in the right column directory

. III. Use Zmodem to upload files from the client to the linux server

1. Use SecureCRT to log in to the linux terminal.
2. Select the path where you want to place the uploaded file, enter the rz command in the directory, SecureCRT will pop up a file selection dialog box, in the search range Find the file you want to upload and press the Add button. Then OK can upload the file to linux.
Or in the Transfer->Zmodem Upoad list, a file selection dialog box pops up. After selecting the file, press the Add button. Then the OK window closes automatically. Then select the directory where the file is stored under linux and enter the rz command. liunx uploads the file to this directory.



Four. Use Zmodem to download files to the client:
#p#page title#e#sz filename
zmodem can be started by itself. The downloaded files are stored in the default download directory you set.


rz, sz are Linux/Unix and Windows ZModem files The command line tool windows side of the transmission needs to support the telnet/ssh client of ZModem, SecureCRT can use SecureCRT to log in to the Unix/Linux host (telnet or ssh can be used) O Run the command rz, that is, to receive the file, SecureCRT will pop up the file Select the dialog box, close the dialog box after selecting the file, and the file will be uploaded to the current directory O Run the command sz file1 file2 to send the file to windows (the saved directory can be configured) It is much more convenient than the ftp command, and the server does not need to be Open FTP service

Reprinted in: http://www.itxuexiwang.com/a/liunxjishu/2016/0307/268.html?1457429571

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326719750&siteId=291194637