Skip to main content

VSFTPD SERVER WITH MULTIPLE USERS ABLE TO ACESS SHARED FOLDER

First install vsftpd package
#yum install vsftpd -y

Open vsftpd configuration file and the check the directives is as follows(if not present add it)
#vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO  (restricting anonymous users)
local_enable=YES (When enabled, local users are allowed to log into the system.)
local_root=/test (this mention the root directory of ftp server)
pasv_promiscuous=YES (if gave no the ftp server will checks wheather the client is connecting to transfer port and control port is same and if we give yes it will not check )

Now start the service
#service vsftpd start
create directory
#mkdir /test
create a group which have acess to out ftp directory
#groupadd ftpgroup
create a user with no shell login and home directory /test under ftpgroup
#useradd -g ftpgroup -s /sbin/nologin ftpuser1
#useradd -g ftpgroup -s /sbin/nologin ftpuser2
set password for ftpuser1 and ftpuser2
#password ftpuser1
#chmod 775 /test
#chown ftpuser1:ftpgroup /test

Now go to client server.Try accessing as ftpuser1 and ftpuser2
We want to install ftp package in client for that
#yum install ftp -y
ftp <server ip>
It will ask for username and password.Login to it


similarly login by ftpuser2