Ftp connection to virtual machine linux

Source: Internet
Author: User

Ftp connection to virtual machine linux

1. install ftp

Download the RHEL6.4 64bit trial version from the redhat official website www.redhat.com (You must register it with your enterprise email address as a partner instead of an individual user). After installation, you will find that the system has no ftp command. Because RHEL6.4 is not registered in the trial version, yum cannot be used. Then try to use rpm to install the corresponding ftp installation package from the CD.
1. First mount the system installation disk, mount/dev/cdrom/mnt

(You can first find the ftp-0.17-53.el6.x86_64.rpm in the Packages folder or other, and then mount the system installation disk)
2. Enter the cd, find the installation package, cd/mnt/Packages
3. [root @ localhost Packages] # ls-a | grep ftp *
Ftp-0.17-53.el6.x86_64.rpm
4. Installation Program, rpm-ivh ftp-0.17-53.el6.x86_64.rpm
5. After the installation is complete, check the chkconfig -- list service and find that the vsftpd service has been installed.
Note: The ftp service startup and shutdown commands are: service vsftpd strat/stop/restart.

2. If chkconfig -- list does not have the vsftpd service, you need to install vsftpd.

① Set the yum software source to a local ISO

Right-click the VM name and choose "set"> "option"> "shared folder"> "enable"> "add". (The folder where the linux image file on the computer is located, for example :)

/Mnt/hgfs/ISO path can find the shared image file: rhel-server-6.3-x86_64-dvd.iso

② First Mount ISO to a directory (for example, My:/media/rheliso /):

# Mount-o loop/mnt/hgfs/ISO/rhel-server-6.3-x86_64-dvd.iso/media/rheliso/

Edit rhel-source.repo

# Vi/etc/yum. repos. d/rhel-source.repo

Add:

[Server]

Name = rhel5server

Baseurl = file: // media/rheliso/Server

Enable = 1

Gpgcheck = 1

Gpgkey = file: // media/rheliso/RPM-GPG-KEY-redhat-release

④ Install vsftpd

# Yum install vsftpd (select "y" for determination during installation ")

⑤ Configure vsftpd

# Vi/etc/vsftpd. conf

After the vsftp software package is installed, the vsftp System Service is automatically added. The vsftp service can be started and terminated through the "/etc/init. d/vsftp" script.
The configuration file of the vsftp service is located in the/etc/vsftp/folder by default. It mainly includes the user control list file (ftpusers, user_list) and the main configuration file (vsftpd. conf ).
The ftpusers and user_list files contain a list of FTP users. Both files are used for FTP user control, but their specific functions are different.
Ftpusers file: the user account contained in this file is forbidden to log on to the vsftp server, regardless of whether the user is in the user_list file. Usually, special users such as root, bin, and daemon are not allowed to log on to the FTP service.

(For example, if you want to use root login, delete the root in ftpusers to avoid being banned by vsftp)
User_list file: the user account contained in this file may be disabled or allowed to log on, which is determined in the main configuration file vsftpd. conf.

When the "userlist_enable = YES" configuration item exists, the user_list file takes effect. If "userlist_deny = YES" is configured, only logon to the user account in the list is prohibited,

If "userlist = deny = NO" is configured, only user accounts in the list are allowed to log on.

Bytes --------------------------------------------------------------------------------------------------------------------
Common vsftpd. conf configuration items and their meanings

Anonymous_enable = YES whether anonymous access is allowed
Local_enable = YES: whether to allow access by local system users
Write_enable = YES enable any form of write permission (such as uploading and deleting files ).
Local_umask = 022 set the default permission mask for the files uploaded by the local user
Dirmessage_enable = YES the content of the. message file (if any) is displayed when the user switches to the directory.
Xferlog_enable = YES enables xferlog, which is recorded in the "/var/log/xferlog" file by default.
Connect_from_port_20 = YES allow active server mode (Data Connection established from Port 20)
Xferlog_std_format = YES enable the standard xferlog format. If this option is disabled, the log format of vsftp is used.
Listen = YES whether to listen to the Service in standalone Mode

Pam_service_name = vsftpd
Userlist_enable = YES (the user_list file takes effect)
Tcp_wrappers = YES
Userlist_deny = NO (only allow user accounts in the list to log on)
Userlist_file =/etc/vsftpd/user_list (ADD)

6. Create a user and a home directory

# Useradd user1

# Mkdir-p/var/ftp/pub

# Ls-ld/var/ftp/pub

7. Start the vsftpd service.

Chkconfig--list

Service vsftpd start/stop/restart

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.