4,461
edits
No edit summary |
→Groups: add other sections |
||
Line 4: | Line 4: | ||
== Add a new group == | == Add a new group == | ||
< | <syntaxhighlight lang="bash"> | ||
$ sudo addgroup webdev | $ sudo addgroup webdev | ||
</ | or | ||
$ sudo groupadd webdev | |||
</syntaxhighlight> | |||
== Delete a group == | == Delete a group == | ||
< | <syntaxhighlight lang="bash"> | ||
$ sudo delgroup webdev | $ sudo delgroup webdev | ||
</ | or | ||
$ sudo groupdel webdev | |||
</syntaxhighlight> | |||
== Add a user to a group == | == Add a user to a group == | ||
< | <syntaxhighlight lang="bash"> | ||
$ sudo adduser username groupname | $ sudo adduser username groupname | ||
</ | or | ||
$ sudo useradd -a G groupname username | |||
</syntaxhighlight> | |||
== Change a user's primary group == | |||
<syntaxhighlight lang="bash"> | |||
$ sudo usermod -g groupname username | |||
</syntaxhighlight> | |||
== Check user's group assignments == | |||
<syntaxhighlight lang="bash"> | |||
$ id username | |||
or | |||
$ groups username | |||
or | |||
$ id -Gn username | |||
</syntaxhighlight> | |||
== Set a directory writable by a certain group == | == Set a directory writable by a certain group == |