Upload and download files using SECURECRT on the Linux command line

Source: Internet
Author: User
Tags control characters file transfer protocol

In general, most of the Linux server through the SSH client for remote login and management, using SSH login to the Linux host, how to quickly and the local machine for file interaction, that is, upload and download files to the server and local? The two commands associated with SSH can be easily manipulated:
SZ: Send the selected file (send) to the local machine
RZ: Run this command will pop up a file Selection window, from the local select File upload to the server (receive)

Rz,sz is the command-line tool that Linux/unix ZModem file transfer with Windows

The Windows side needs to support Zmodem TELNET/SSH clients (such as SECURECRT)

Server side also need corresponding software Lrzsz, but generally installed, if not installed, will prompt: Bash:rz:command not found

Install Lrzsz:
/# yum-y Install Lrzsz
Now you can use RZ, sz command to upload, download data.

How to use:
Uploading files
/# RZ filename
Download file
/# sz filename

Run the command RZ, that is, to receive the file, SecureCRT will pop up the file selection dialog box, select the file and close the dialog box, the file will be uploaded to the current directory

Note: Using RZ alone will have two problems: Upload interrupt, upload file changes (MD5 different), the solution is to upload is rz-be, and remove the popup dialog box "Upload files as ASCII" before the check.
-b binary uploads the download in binary mode, does not interpret the character as ASCII
-E force escape all control characters, such as Ctrl+x,del, etc.

Run the command sz file1 file2 is to send files to Windows (the saved directory can be configured) more convenient than the FTP command, and the server does not have to open the FTP service

Ps:linux on the Rz/sz these two gadgets installed lrzsz-x.x.xx.rpm can be.

Of course, you can also set up the directory:

Set up the default directory for uploads and downloads in SECURECRT
Options–>session options–>file transfer can be set to upload and download the directory
The rest of you just log in to the Linux terminal with SECURECRT:
Send file to client: SZ filename
Zmodem receive can start on its own.
Upload files from client to Linux server:
As long as the server execution: RZ
Then select the file to send in SecureCRT, protocol Zmodem
----------------
Introduction to the File Transfer tool Rz/sz (LRZ/LSZ) between Linux and Windows

"What is Rz/sz (LSZ/LRZ)"

Simply put, it is easy to use these two sz/rz tools to achieve the file transfer (send and receive) between Linux and Windows, the speed is about 10kb/s, suitable for small and medium-sized files. RZ/SZ transmits data through the Zmodem protocol.

"Why use Rz/sz?"

Common Linux and the method of file sharing between windows, mainly the establishment of NFS implementation of file sharing, and TFTP and other methods, but all very cumbersome, and if only small files (dozens of k, hundreds of k), then directly with the RZ/SZ, it is extremely convenient. Big file words, still want to consider above said, other sharing method, after all, Rz/sz speed only about 10K, transfer big file will be exhausted people's ...

"How to use"

(1) Under Windows, connect the COM port to the Development Board with SECURECRT (or a hyper-terminal that comes with Windows), or connect to a Linux server with protocols such as SSH.

(2) on the Linux side, after installing the Rz/sz (LRZ/LSZ) tool (embedded development, most of the compiled Rz/sz tools have been put into the rootfs, the ordinary Linux system, if not, you can download the source code, their own installation), you can directly run Rz/sz, The implementation and file transfer between Windows:

A. Copy/download files from Windows to Linux (Development Board):

After running RZ, automatically pops up the File selection dialog box under Windows, selects the corresponding file, adds, and then determines, starts the transfer, and copies the files in Windows to Linux.

B. copy files from Linux to a folder in Windows:

The SZ file_name can be used to copy files from the current folder of Linux file_name to the corresponding directory in Windows, where the Windows directory is set by the tool you are currently running.

Here I use SECURECRT, the specific change rz upload/sz Download The default path method:

Right-click the session, Terminal, Xmodem/zmodem->directories:

Upload: The path you want to set

Download: The path you want to set

The file Transfer protocol under SECURECR is ASCII, Xmodem, Zmodem
File Transfer Protocol
File transfer is the main form of data exchange. In the case of file transfer, in order for the file to be correctly identified and transmitted, we need to establish a unified transport protocol between the two computers. This protocol includes the identification of documents, the starting and ending time of transmission, the judgment and correction of errors, etc. The common transport protocols are as follows:
ASCII: This is the fastest transport protocol, but only text files can be transferred.
Xmodem: This ancient transmission protocol is slow, but due to the use of CRC error detection method, the transmission accuracy rate can be as high as 99.6%.
Ymodem: This is an improved version of Xmodem, which uses 1024-bit segments to deliver faster than Xmodem.
Zmodem:zmodem adopts the stream-flow (streaming) transmission mode, the transmission speed is fast, but also has the function of automatically changing the section size and the breakpoint continuation transmission, the fast error detection and so on. This is currently the most popular file transfer protocol.
In addition to the above several, there are Imodem, Jmodem, Bimodem, Kermit, lynx and other agreements, because there is no majority of manufacturers support, here is omitted to say.

Resources:

Http://www.cnblogs.com/276815076/archive/2011/09/22/2184804.html

Http://www.cnblogs.com/harryguo/archive/2008/01/16/1041296.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.