Create a new user in vsftp in centos 5.3

Source: Internet
Author: User

I recently learned about Linux and want to configure an FTP server on Linux. I used the source code to compile and install vsftpd 2.1.2. The installation process is fine, and some problems are encountered during the configuration process. The following configuration process and solution:

 

1. Method 1:

First create a system user, and then modify the/etc/passwd file

The command is as follows (mytest is the user name ):

# Create a system user and set the password

[Root @ localhost Home] # useradd mytest

[Root @ localhost Home] # passwd mytest

[Root @ localhost Home] # passwd mytest

Changing password for user mytest.

New UNIX password:

Bad password: it is based on a dictionary word

Retype new Unix Password:

Passwd: All authentication tokens updated successfully.

In this way, the user has system permissions, and the following methods are used to remove the user's system permissions.

# Modify the/etc/passwd file [root @ localhost etc] # cd/etc [root @ localhost etc] # vi passwd # Find the added user (mytest) and modify it as follows, before that, make sure that the folder/home/mytest has mytest: X: 501: 50: Test FTP user:/home/mytest/:/sbin/nologin, where mytest indicates the user name; X indicates encryption; 500 indicates uid; 50 indicates GID; here 50 indicates ftp group; test FTP user indicates description of the user;/home/testftp indicates the user's home directory; /bin/nologin indicates that you cannot log on to the system. Method 2: Use the command [root @ localhost etc] # useradd-D/home/mytest/-g ftp-S/sbin/nologin mytest to create a new user. However, the following prompt appears when I log in after creating a user: [root @ localhost etc] # ftp localhostconnected to localhost. localdomain.220 (vsftpd 2.0.5) 530 please login with user and pass.530 please login with user and pass. export OS _v4 rejected as an authentication typename (localhost: Root): mytest331 please specify the password. password: 500 Oops: cannot change Directory:/home/mytestlogin failed. here is the solution: First, check the permissions of the mytest folder [root @ localhost Ho Me] # ls-l mytestdrwxr-XR-x 2 root Root 4096 08-10 mytest found that permissions are not set, here, I use the drwxrwxrwx permission [root @ localhost Home] # chmod 777 mytest to set the permission and restart vsftpd [root @ localhost Home] # after the service vsftpd restart logon, the above problems may occur, this may be a problem with SELinux. The following is a solution: [root @ localhost Home] # setsebool-P ftpd_disable_trans 1. This is about SELinux settings, it may be to allow vsftpd to take effect through SELinux. The P option is valid for a long time. If the P option is not added, the setsebool-P ftpd_disable_trans 1 command may be used after restart to solve the above problems. Now, the new user is created and can be logged in and used. [Root @ localhost Home] # ftp localhostconnected to localhost. localdomain.220 (vsftpd 2.0.5) 530 please login with user and pass.530 please login with user and pass. export OS _v4 rejected as an authentication typename (localhost: Root): mytest331 please specify the password. password: 230 login successful. remote system type is UNIX. using binary mode to transfer files. ftp>
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.