marcov4lente
3/13/2017 - 9:28 PM

Linux Operations

Linux Operations

User Management

Create new user

$ adduser username

Add user to sudo group

usermod -aG sudo username

Change password

$ passwd

Folder Permissions

Change folder owner

$ chown you:yourgroup /home -R

Recursively add read/write permissions for the owner and group

chmod -R ug+rw foldername

Web root folder permissions

Set group of folder to www-data.

$ sudo chgrp www-data /var/www

Make it writable.

sudo chmod 775 /var/www

Set group id for subfolders.

sudo chmod g+s /var/www

Add username to the group

sudo useradd -G www-data [USERNAME]

Set folder perms for /var/www

chmod -R ugo+rwx folder