A. Overview
This article describes how to transfer files between a Linux host and a Windows host. Because sometimes, some files in a Linux host may be used in a Windows environment. For example, in the Linux host grabbed some pictures, want to upload them to the Windows host as a Word document illustrations. Or the Internet from the Windows host, download some of the Linux software packages, want to upload to the Linux host installation. In these cases, there is a need for a way to interoperate between the two.
This article uses the FTP method to transmit the file, the software uses the serv-u. Install serv-u under the Widows host, make it an FTP server, upload and download files under the Linux host via FTP commands. After testing, it can meet the needs well.
two. Experimental environment
Software Environment:
A machine:
Operating system: Windows2000, ip:10.18.34.115.
B Machine:
Operating system: Linux Red Hat 9.0, ip:10.18.34.251.
three. Installation
1. Installation of Serv-u
Execute Setup.exe, select all the default options.
2. General Settings for Serv-u
After the installation is complete, the Configuration Wizard dialog box appears, where you can configure a successful FTP server by filling in the appropriate information as required. The IP address of the A machine here is 10.18.34.115. Follow the Setup Wizard to do the following:
1) IP address (IP): Enter "10.18.34.115". (This entry is empty if a dynamic or no legal IP address is used).
2) Domain name: Enter the domain name, for example "rosered" (here is optional).
3) Install as System server (install as a system servers): Select "Yes".
4) Allow anonymous access (accept anonymous login): Here you can choose according to your needs, such as "Yes".
5) Anonymous home directory (anonymous home directory): Here you can enter (or select) a home directory for anonymous users to log in.
6) Lock anonymous users in to their home directory (lock the user in the home directory that you just selected): whether to set the home directory of the previous step to the user's root, and generally choose "Yes".
7) Create named account (set up other accounts): here to ask whether to establish a normal login user account; generally choose "Yes".
8) Account login name (user login): normal user name, e.g. enter "Yint".
9) Password (password): Set user password. Because the password entered is shown here in clear text (instead of *), it is lost only once.
Home directory: Enter (or select) the user's home directory, such as "E:\" (this article will operate on files on e:\).
Lock anonymous users in to their home directory (lock the user in the home directory): Select "Yes".
Accounts admin privilege (account management privilege): It is generally used with its default value "No privilege" (normal account).
13) Select "Finish" at the end to complete the setup.
Set up an FTP server, the server address is "rosered", under which there are two users, one is anonymous user "Anonymous", the password is empty; one is the normal user "Yint", whose password is the content entered in the wizard.
3. Permission settings for Serv-u
For example, the "Yint" User is selected in the left panel, and the Settings window appears in the right panel. Select the dir access (Directory Access) tab to set whether the user has read (read), write, Append (write and add), delete, and Execute on the file in its home directory ("E:\" here). (execute) permissions, whether the directory has a "list" (Display of files and directories), "Create" (Create a new directory) and "Remove" (Modify directory, including delete, move, rename) permissions, and so on.
Can be set as required, generally read, Write selected.
Iv. using the FTP command under Linux
1. Connect to the FTP server
Format: FTP [hostname ip-address]
A) under Linux command line input: FTP 10.18.34.115
b) The server asks you for your username and password, enter yint and corresponding password separately, and wait for authentication to pass.
2. Download the file
The download file usually uses the get and mget two commands.
a) Get
Format: Get [Remote-file] [local-file] transfers files from the remote host to the local host. To obtain the E:\rose\1.bmp on the server:
Ftp> get/rose/1.bmp 1.bmp (return) |
b) mget
Format: mget [Remote-files] receives a batch of files from the remote host to the local host. To obtain all the files under E:\rose\ on the server:
ftp> cd/rose ftp> mget * * (carriage return) |
Note: The files are downloaded to the current directory of the Linux host. For example, the FTP command that runs under/root/yint, the files are downloaded to/root/yint.
3. Uploading Files
a) put
Format: Put Local-file [remote-file] transfers a local file to the remote host. If you want to transfer the local 1.bmp to the remote host E:\rose, and renamed to 333.bmp
Ftp> put 1.bmp/rose/333.bmp (carriage return) |
b) mput
Format: mput local-files transfers A batch of files from the local host to the remote host. To upload all BMP files in the local current directory to the server E:\rose
Ftp> cd/rose (carriage return) ftp> mput *.bmp (carriage return) |
Note: The upload file is from the current directory of the host. For example, the FTP command running under/root/yint will only be uploaded to the server E:\rose under/root/yint file Linux.
How to transfer files between a Linux host and a Windows host