Manage users on your system

This is a quick checklist on how to create a user from the command line:
1. useradd -m new_username (add a user called new_username with a home directory)
2. passwd new_username (set a password for new_username)
3. (optional) usermod -aG wheel new_username  (to include the user in the sudoers list)
4. su - new_username (to change to the new_username account)
NOTE: sudo usermod -a -G sudo username (to include user ‘username’ in the sudo group)

EDIT:

5. usermod -s /bin/bash NEW_USERNAME(to set the shell as bash. Change for other shells)

If you need to grant access to you system just for specific applications, you can tweak the visudo file. Using an admin user, issue:

  1. $ sudo visudocmnd_alias
  2. group the commands into aliases (line 18). List all commands you want to grant, separate by comma
  3. grant access to them (line 22). The ‘NOPASSWD’ will restrain to ask for a password for the minicom command. All the other commands ran with sudo will prompt for a password and will fail. To require password, do not include the ‘NOPASSWD’ tag.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s