-2

I Need new sftp login details for developers but that is restricted to /var/www/html/ using ssh. They have to be able to edit and save files, also when the user makes changes I don't want the group changing to the users group once they make changes, if that makes sense.

slm
  • 7,355
  • 16
  • 54
  • 72
Joe Moe
  • 1
  • 1

3 Answers3

1

You could use ACLs here.

Create your user with useradd. Then grant him the correct permission on /var/www/html

#> setfacl -m u:myuser:rwx /var/www/html

Use -R option, to modify all the subdirectories

#> setfacl -R -m u:myuser:rwx /var/www/html

Verify that it worked by using getfacl

#> getfacl /var/www/html

Also for your group name request, you might want to flag the html directory with the setgid flag chmod +s /var/www/html

Spredzy
  • 955
  • 8
  • 11
0

You can create a user with

 useradd -D /var/www/html xyz 

so /var/www/html will be the default home directory for user xyz , but if you are running apache and /var/www/htmlis home directory than this solution is not gonna work.

Instead you should create a user with any other home directory and restrict user with SUDO access for APACHE.

0

I will suggest you to use httpd-itk from epel to run each site by own user. And proftpd (mod_sftp) to gain access to the web root.

ALex_hha
  • 7,025
  • 1
  • 23
  • 39