User accounts: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
add a category
No edit summary
Line 1: Line 1:
[[Category:System administration]]
[[Category:System administration]]
= Groups =
= Groups =



Revision as of 10:31, 2 August 2016

Groups

Add a new group

$ sudo addgroup webdev

Delete a group

$ sudo delgroup webdev

Add a user to a group

$ sudo adduser username groupname

Set a directory writable by a certain group

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

$ sudo setfacl -d -m g:dev:rwx /srv/www

Add a user account

$ sudo useradd -d /home/jsmith -m jsmith -G webdev
$ sudo passwd jsmith

Delete a user account

Force removal and delete files

$ sudo userdel -fr username

or

$ sudo deluser -remove-home username

Lock or unlock a user account

$ sudo passwd -l username
$ sudo passwd -u username

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.

jsmith ALL=(ALL) NOPASSWD:ALL

If you want the user to type a password.

jsmith ALL=(ALL:ALL) ALL