Install and Configure FTP for loading and unloading in Ubuntu, and configure Local User Logon (which is feasible in test). install and configure ubuntu

Source: Internet
Author: User

Install and Configure FTP for loading and unloading in Ubuntu, and configure Local User Logon (which is feasible in test). install and configure ubuntu

Reprinted: http://zyjustin9.iteye.com/blog/2178943

1. Installation
1. Install vsftpd with apt-get:

Java code
  1. $ Sudo apt-get install vsftpd

 
2. Check whether the FTP port is enabled.

Java code
  1. $ Netstat-tnl



Alternatively, enter "ftp: // server IP Address" in the browser"

Command for enabling, stopping, and restarting the vsftpd service:

Xml Code
  1. Service vsftpd start | stop | restart


Ii. Configuration
1. modify the configuration file

Java code
  1. $ Sudo vi/etc/vsftpd. conf


Main Configuration:

Xml Code
  1. Listen = YES # server listener
  2. Local_enable = YES # whether to allow access by local users
  3. Write_enable = YES # whether to allow file upload. If this parameter is not enabled, the system reports 550 permission denied.
  4. Anonymous_enable = NO # anonymous access is allowed. It is disabled by default,
  5. # Anon_upload_enable = YES # anonymous upload is allowed. The default value is NO.
  6. # Anon_mkdir_write_enable = YES # Allow Anonymous Folder creation


User access directory permission settings:
By default, after logging on to FTP, a local user can use the cd command to switch to another directory, which brings security risks to the system. You can use the following three configuration files to control user directory switching.

Xml Code
  1. Chroot_local_user = YES # specifies whether the user in the user list file can switch to the parent directory. The default value is NO.
  2. Chroot_list_enable = YES # Sets whether to enable the user list file specified by the chroot_list_file configuration item. The default value is NO.
  3. Chroot_list_file =/etc/vsftpd. chroot_list
  4. # The Disabled list, in the format of one user per row, is used to specify the user list file, which is used to control which users can switch to the parent directory of the user's home directory.

 
The following effects can be achieved through combination:

Xml Code
  1. (1 ). when chroot_list_enable = YES, chroot_local_user = YES, in/etc/vsftpd. users listed in the chroot_list file can switch to other directories. Users not listed in the file cannot switch to other directories.
  2. (2 ). when chroot_list_enable = YES, chroot_local_user = NO, in/etc/vsftpd. users listed in the chroot_list file cannot switch to other directories. Users not listed in the file can switch to other directories.
  3. (3). When chroot_list_enable = NO, chroot_local_user = YES, all users cannot switch to other directories.
  4. (4). When chroot_list_enable = NO and chroot_local_user = NO, all users can switch to other directories.

 

Other configurations:

Xml Code
  1. Local_umask = 022 # local file permission on FTP. The default value is 077.
  2. Dirmessage_enable = YES # enter the folder to allow
  3. Xferlog_enable = YES # ftp logging allowed
  4. Connect_from_port_20 = YES # enable port 20 as the data transmission Port
  5. Xferlog_enable = yes # activate upload and download logs
  6. Xferlog_std_format = yes # use the standard log format
  7. Ftpd_banner = XXXXX # Welcome Information

 
Related links:
Vsftpd configuration file details

2. Restart the vsftpd service.

Java code
  1. $ Sudo/etc/init. d/vsftpd restart
  2. Or
  3. $ Sudo service vsftpd restart

Note: After modifying the configuration file, you must restart the service to take effect.

 
3. add and delete users through FTP
1. Add users
# Creating a directory

Java code
  1. Mkdir-p/home/

 
# Create a user

Java code
  1. Sudo useradd-g ftp-d/home/test456-m test456

(Note: g: the user's Group d: Specifies the location where the user's own directory is created. m: No default home directory is created, that is, no home directory exists under/home)

# Set a User Password

Java code
  1. Sudo passwd test456

 
Edit the/etc/vsftpd. chroot_list file, add the account name of ftp (test456), save and exit.

Restart vsftpd:

Java code
  1. $ Sudo service vsftpd restart

Note: After modifying the user permission file vsftpf. chroot_list, you must restart the service to make the modification take effect.

2. Enter the Firefox browser and enter ftp: // 192.168.132.132 (the IP address here is the IP address of your host. If you do not know it, you can use ifconfig to view it)

Shows the final effect:



3. delete a user

Java code
  1. $ Sudo userdel test456

 


4. Uninstall

Sudo apt-get remove -- purge vsftpd

(-- Purge option indicates that the software modification and related files are permanently deleted)


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.