Wednesday, November 21, 2018

תזכורת פקודות הרשאות linux groups

Chmod for files:
chmod u=rwx,g=rx,o=r myfile

Get user and groups:
id www-data

Adding a user to a group:
sudo usermod www-apache --append --groups [groupname]

Removing user from group
sudo deluser username group

Change ownership:
chown {-R} [user]{:group} [file|directory]

Change group:
chgrp {-R} [group] [file|directory]

Login with www-data user (www-data is set to /usr/sbin/nologin):
sudo su -l www-data -s /bin/bash