Create an FTP user in Linux

Source: Internet
Author: User
Tags ftp login

Http://sookk8.blog.51cto.com/455855/151736

 

1. Install vsftpd:
Run Yum install vsftpd in shell to install it successfully;

2. Modify vsftpd Configuration:
Find vsftpd in/etc/vsftpd. CONF file, modify the default configuration, including the listening address and port, whether to enable the TCP and psav modes, etc. The configuration is relatively simple. For details, refer to vsftpd configuration manual 3 in my article. start the vsftpd service:
Run service vsftpd start, or run/etc/init. d/vsftpd start.
4. Create a user and logon directory for FTP
This is the same as creating a user account in Linux. first create a user account to the FTP directory with "useradd-d directory name username", and then set the password with passwd; then you can use the username and account you created to log on to the FTP. The FTP login method is secure FTP account creation method useradd username-S/bin/false to prohibit SSH login. Useradd-S/bin/false-D/www/www.a.com/www username specify the directory FTP host name;
Enter the user name;
Enter the password.
Of course, you can also use ftp. However, in this way, only the default permission can be read and cannot be written, so you must perform this operation to write the CHMOD 700 directory name chmod user name directory name to enable ftp
[Root @ huiyi ~] # Service vsftpd start starting vsftpd For vsftpd: [OK] disable FTP
[Root @ huiyi ~] # Service vsftpd stop shutting down vsftpd: [OK] [1] FTP automatic logon and batch download
#! /Bin/bash
FTP-n <open 192.168.1.171
User guest 123456.
Binary
CD/home/Data
LCD/home/databackup
Prompt
Mget *
Close
Bye
! [2] FTP automatic logon and File Upload
#! /Bin/bash
FTP-n <open 192.168.1.171
User guest 123456.
Binary
Hash
CD/home/Data
LCD/home/databackup
Prompt
Mput *
Close
Bye
! Try FTP in Linux. Edit the/etc/vsftpd. conf file so that the content of the entire file is as follows (the comment is removed ):

Anonymous_enable = No # disable anonymous user logon
Local_enable = yes # enable local user logon
Local_umask = 022 # file creation permission
Xferlog_enable = yes # Enable Logging
Connect_from_port_20 = yes # enable port 20 for data transmission
Xferlog_std_format = yes # log record format
Listen = yes # listener
Write_enable = yes # write permission on the object
Anon_upload_enable = yes # Allow Anonymous uploads
Anon_mkdir_write_enable = yes # Allow anonymous users to create directories
Anon_other_write_enable = yes # Do you have other permissions?
One_process_model = No
Chroot_local_user = Yes
Ftpd_banner = Welcom to my FTP server.
Anon_world_readable_only = No
Guest_enable = Yes
Guest_username = virtual_user
Pam_service_name = vsftp. vu

In the code above, guest_enable = Yes indicates that a virtual user is enabled; guest_username = Virtual indicates that a virtual user is mapped to a local user, so that the virtual user can log on to the local user's virtual directory/ftpsite; pam_service_name = vsftp. the configuration file of PAM specified by VU is vsftp. vu.

Related Article

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.