System administration: Difference between revisions

Jump to navigation Jump to search
→‎User Accounts: remove user accounts section (moved)
add a separate page for user accounts
→‎User Accounts: remove user accounts section (moved)
Line 174: Line 174:
$ df -h
$ df -h
</syntaxhighlight>
</syntaxhighlight>
= User Accounts =
== Groups ==
=== Add a new group ===
<source lang="bash">
$ sudo addgroup webdev
</source>
=== Delete a group ===
<source lang="bash">
$ sudo delgroup webdev
</source>
=== Add a user to a group ===
<source lang="bash">
$ sudo adduser username groupname
</source>
=== Set a directory writable by a certain group ===
Make /srv/www folder readable/writable/executable by dev group
<source lang="bash">
$ sudo setfacl -d -m g:dev:rwx /srv/www
</source>
== Add a user account ==
<source lang="bash">
$ sudo useradd -d /home/jsmith -m jsmith -G webdev
$ sudo passwd jsmith
</source>
== Delete a user account ==
Force removal and delete files
<source lang="bash">
$ sudo userdel -fr username
</source>
or
<source lang="bash">
$ sudo deluser -remove-home username
</source>
== Lock or unlock a user account ==
<source lang="bash">
$ sudo passwd -l username
$ sudo passwd -u username
</source>
== Adding sudoers ==
A file can be added for groups of users or specific users to /etc/sudoers.d/ directory. This line would make someone a sudoer with no password requirement.
<source lang="html5">
jsmith ALL=(ALL) NOPASSWD:ALL
</source>
If you want the user to type a password.
<source lang="html5">
jsmith ALL=(ALL:ALL) ALL
</source>


= Samba =
= Samba =

Navigation menu