Skip to main content
improved formatting
Source Link
peterph
  • 31.5k
  • 3
  • 74
  • 76

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

usermod -a -G ftpuser my-ftp-user
usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

$ su my-ftp-user

$ cd /var/www/website

$ ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

$ cat index.php // WORKS

$ touch test.txt // DOESN'T WORK : permission denied, why ?

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

usermod -a -G ftpuser my-ftp-user
usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

su my-ftp-user

cd /var/www/website

ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

cat index.php // WORKS

touch test.txt // DOESN'T WORK : permission denied, why ?

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

usermod -a -G ftpuser my-ftp-user
usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

$ su my-ftp-user

$ cd /var/www/website

$ ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

$ cat index.php // WORKS

$ touch test.txt // DOESN'T WORK : permission denied, why ?

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website/var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website/var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

> usermod -a -G ftpuser my-ftp-user
> usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website/var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website/var/www/website, am I not ?

> su my-ftp-user

> cd /var/www/website

> ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

> cat index.php // WORKS

> touch test.txt // DOESN'T WORK : permission denied, why ?

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

> usermod -a -G ftpuser my-ftp-user
> usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

> su my-ftp-user

> cd /var/www/website

> ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

> cat index.php // WORKS

> touch test.txt // DOESN'T WORK : permission denied, why ?

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

usermod -a -G ftpuser my-ftp-user
usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

su my-ftp-user

cd /var/www/website

ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

cat index.php // WORKS

touch test.txt // DOESN'T WORK : permission denied, why ?
Source Link
Flo Schild
  • 723
  • 6
  • 7

Debian file's permissions for secondary's group of user

I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : /var/www/website

I have added a new user : my-ftp-user This user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).

So I changed the user's groups :

> usermod -a -G ftpuser my-ftp-user
> usermod -a -G www-data my-ftp-user

The permissions of folder /var/www/website are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode.

If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?

> su my-ftp-user

> cd /var/www/website

> ls -la

drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .
drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..
-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php

> cat index.php // WORKS

> touch test.txt // DOESN'T WORK : permission denied, why ?