24. AZURE – ProFTPd user management -Part2

 

Part 2 of the video how to install and configure ProFTPd.

HERE:
1. How to create users using SSH
2. How to create users using Webmin

how to create users and how to lock them only into Apache folder so each users can access ONLY the web site where is authorize to develop

https://youtu.be/cxxDt_2OnC4

1- USER with SSH commands
——————————————-
Add this line in /etc/shells file  (this will have option to have users without shell:
sudo nano /etc/shells
Code to add at the end:
/bin/false
————-
If no directory in apache you can create with:
 sudo mkdir /var/www/websitedirectory
———————-(for this demo websitedirctory will be (test3)——–


clear cd /var/www/ sudo mkdir test3 cd test3 sudo mkdir down3 sudo mkdir up3 cd .. sudo chmod 755 test3 cd test3 sudo chmod 755 down3 sudo chmod 777 up3

CREATE USER:
sudo useradd user3 -p your_password -d /var/www/test3 -s /bin/false sudo passwd user3

 GIVE PERMISSIONS: sudo chown user3:www-data /var/www/test3/up3 sudo chown user3:www-data /var/www/test3/down3 sudo chown user3:www-data /var/www/test3 
—————- To stop the FTP server:  sudo service proftpd stop OR: sudo /etc/init.d/proftpd stop ——————————— EDIT CONFIG FILE: sudo nano /etc/proftpd/proftpd.conf

comment with adding # in front: […] #DefaultRoot ~ […]
 Now at the end of the file add: […] #VALID LOGINS
<Limit LOGIN>
AllowUser user3
DenyALL
</Limit>


DefaultRoot /var/www/test3 user3
<IfModule mod_facts.c>     FactsAdvertise off   </IfModule>
<Global> DefaultRoot /var/www/ </Global>
[…]
(HERE THE IMPORTANT PART IS YOU CAN ADD MANY USERS ADDING:

AllowUser user1  
AllowUser user2
….

AND FOR EACH USER ADD LINE, do not forget the space between dir and user_group name:

DefaultRoot /var/www/dir1 user1_group DefaultRoot /var/www/dir2 user2_group
————————— 
To start FTP server: sudo /etc/init.d/proftpd start OR:  sudo service proftpd start

——————————— END  SSH user ————


2- USER with Webmin
——————————————-

here nothing to copy paste except the ProFTPd config file… the rest is on the video.
– type user
-select home dir (there will be FTP folder)
– create new GROUP
-add additional group selecting WWW-DATA
-create password
-Click SAVE

-now go to FTP config file and edit :
comment with adding # in front: […] #DefaultRoot ~ […]
 Now at the end of the file add: […] #VALID LOGINS
<Limit LOGIN>
AllowUser user3
DenyALL
</Limit>

DefaultRoot /var/www/test3 user3
<IfModule mod_facts.c>     FactsAdvertise off   </IfModule>
<Global> DefaultRoot /var/www/ </Global>
[…]