m
Tag: visualeditor
 
(3 intermediate revisions by the same user not shown)
Line 20: Line 20:
== Add a user to a group ==
== Add a user to a group ==


<syntaxhighlight lang="bash">
<source lang="bash">
$ sudo adduser username groupname
$ sudo adduser username groupname
or
or
Line 26: Line 26:
or
or
$ sudo usermod -a -G groupname username // for an existing user
$ sudo usermod -a -G groupname username // for an existing user
</source>
== Remove a user from a group ==
<source lang="bash">
$ sudo gpasswd -d username groupname
</source>
== List a user's groups ==
<syntaxhighlight lang="bash">
$ id -Gn username
</syntaxhighlight>
== Check a user's primary group ==
<syntaxhighlight lang="bash">
$ getent group username
</syntaxhighlight>
</syntaxhighlight>


Line 45: Line 63:


== Set a directory writable by a certain group ==
== Set a directory writable by a certain group ==
Turn on the SGID bit for the root folder
<source lang="bash">
$ sudo chmod g+s www
</source>


Make /srv/www folder readable/writable/executable by dev group
Make /srv/www folder readable/writable/executable by dev group