You are here
Home > Tricks > Configure FTP Server(vsftpd) for Multiple User with Different Home Directory

Configure FTP Server(vsftpd) for Multiple User with Different Home Directory

vsftpd-featured

Hello Friends, Today we are going to configure FTP Server(vsftpd) for multiptle user with different home directory. In previous post we have already learned how to configure FTP Server(vsftpd) on Google Cloud Compute Engine. If you not already read that post and not configured ftp server then click here to read that post before going through this post. To configure FTP Server(vsftpd) for multiple user with different home directory we just need to follow below steps:-

Step 1: Create two users named as ftpuser1 and ftpuser2 using below command.

Note: It will ask you for password, just enter your desired password and it will also ask for user information i.e. full name, room number, work phone etc, you can skip it by just pressing enter.

Step 2: Configure FTP Server (vsftpd) by updating vsftpd.conf configuration file using below command.

Above command will open vsftpd.conf file in nano editor and then we need to paste below lines at the end of the file.

Note: We need to restart vsftpd every time we do changes in vsftpd.conf configuration file and also checking status is good practice using below command

gcp-ftp-server-restart-check-status

Step 3: Setup home directory

To configure home folder, create the /etc/vsftpd_user_config_dir/ folder and create two files with the exact same name of the two users:

The above nano command will create new file and open it automatically and then we’ll define home folder for first user in the file in following way:

now we’ll create another file for second user same way and edit it but this time home folder will be “/home/ftpuser/ftpuser2”

Step 4: Create home directory for both user using below command

Step 5: Create group and add user into group using below command

Step 6: Change ownership of “/home/ftpuser” directory to ftpusers group and making “/home/ftpuser” directory writable by group using below command so that directory is accessible and writable by all users of group

And we are done!

 

Thanks for stopping by
Please don’t forget to share if it helped

Rajesh Kumar Sahanee
I am a passionate Java Developer and I like Computer Programming. I love to do some interesting experiments and listening music in my free time.
https://www.zatackcoder.com

Comments

zatackcoder
Top

  Â