Mutual file transfer between Linux and windows

Source: Internet
Author: User
Article Title: Cross-file transfer between Linux and windows. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   I. Overview
This article describes how to transfer files between a Linux host and a windows host. Sometimes, some files on the linux host may be used in windows. For example, you have captured some images on a linux host and want to upload them to a windows host as an illustration of a Word document. Or, you can download some linux software packages from the Windows host and want to upload them to the linux host for installation. In these cases, a method is required for intercommunication between the two.
  
This article uses ftp to transfer files, and the software uses Serv-U. Install Serv-U on the widows host to make it an ftp server, and use ftp commands on the linux host to upload and download files. After tests, the requirements can be well met.
  
   Ii. experiment environment
Software environment:
  
Host:
Operating System: windows2000, IP: 10.18.34.115.
  
Machine B:
Operating System: Linux Red Hat 9.0, IP: 10.18.34.htm.
  
   3. Install Serv-U in windows
1. Serv-U Installation
  
Execute setup.exe and select the default option.
  
2. General settings of Serv-U
  
After the installation is complete, the Configuration Wizard dialog box is displayed. Enter the required information here to successfully configure an ftp server. The IP address of host A is 10.18.34.115. Follow the Installation Wizard to perform the following operations:
  
1) IP address: Enter "10.18.34.115 ". (This item is blank if dynamic IP addresses are used or no valid IP addresses exist ).
  
2) Domain name (Domain name): enter a Domain name, for example, "RoseRed ).
  
3) Install as system server (to be installed as a system server): Select "Yes ".
  
4) Allow anonymous access (Do You Want To accept anonymous logon?): Select Yes as needed, for example ".
  
5) anonymous home directory (anonymous home directory): enter (or select) a home directory for anonymous users to log on.
  
6) Lock anonymous users in to their home directory (Lock the user in the selected home directory): whether to set the home directory in the previous step as the root directory of the user; select "Yes ".
  
7) Create named account (do you want to Create another account?): Check whether a Common Logon user account is created. Select Yes ".
  
8) Account login name (User login name): Common User Account name, for example, enter "yint ".
  
9) Password: Set the user Password. Because the entered password is displayed in plain text (rather than *), only once is entered.
  
10) Home directory (main directory): enter (or select) The main directory of this user, for example, "E: \" (this article will operate the files on E ).
  
11) Lock anonymous users in to their home directory (Lock the user in the main directory): Select "Yes ".
  
12) Account admin privilege (Account Management privilege): Generally, the default value "No privilege" is used ).
  
13) Select "Finish" to complete the settings, for example:
    
  
  
We can see that an FTP server has been created with the server address "RoseRed". There are two users under it. One is the Anonymous user "Anonymous" and the password is blank; the password of a common user "yint" is entered in the Wizard.
  
3. Serv-U permission settings
  
For example, if you select the "yint" user in the left-side pane, the settings window, as shown in, appears in the right-side pane. Select the "Dir Access" (directory Access permission) label to set this user in its main directory (here "E :\") whether the file has "Read", "Write", "Append" (Write and add), "Delete", and "Execute) permission; whether the directory has "List" (List of displayed Files And Directories), "Create" (new directory), and "Remove" (modify directory, including deleting, moving, renaming) permissions.
  
You can set it as needed. Generally, Read and Write are selected.
  
  
   4. Use ftp commands in linux
1. Connect to the ftp server
  
Format: ftp [hostname | ip-address]
A) on the linux Command Line, enter ftp 10.18.34.115.
B) The server will ask you for your username and password, and enter the yint and password respectively. You can wait for the authentication to pass.
  
2. Download an object
  
The get and mget commands are usually used to download files.
A) get
Format: get [remote-file] [local-file]
Transfers files from the remote host to the local host.
To obtain E: \ rose \ 1.bmp on the server
Ftp> get/rose/1.bmp 1.bmp (Press ENTER)
  
B) mget
Format: mget [remote-files]
Receives a batch of files from the remote host to the local host.
To obtain all files under E: \ rose \ on the server
Ftp> cd/rose
Ftp> mget *. * (Press ENTER)
  
Note: All files are downloaded to the current directory of the linux host. For example, if you run the ftp command in/root/yint, all files are downloaded to/root/yint.
  
3. upload files
  
A) put
Format: put local-file [remote-file]
Transfers a local file to the remote host.
If you want to transfer 1.bmp of postgresql to the remote host E: \ rose, and rename it 333.bmp
Ftp> put 1.bmp/rose/333.bmp (Press ENTER)
  
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 current local directory to the server E: \ rose
Ftp> cd/rose (Press ENTER)
Ftp> mput *. bmp (Press ENTER)
Note: All uploaded files are from the current directory of the host. For example, if you run the ftp command in/root/yint, it will be uploaded to the server E: \ rose only in the file linux under/root/yint.
  
4. Disconnect
Bye: the connection to the server is interrupted.
Ftp> bye (Press ENTER)

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.