Ubuntu:Feisty/UserAdministration

From

Contents

User Administration

How to switch to root user in Console mode

For a login shell as root, i.e. similar to "su -",

sudo -i
Password: <specify user password>

or

sudo su -
Password: <specify user password>

To start a root shell while maintaining the current directory and various other settings of your normal user (such as the USERNAME environment variable):

sudo -s -H
Password: <specify user password>

or

sudo su
Password: <specify user password>

How to set/change/enable root user password

sudo passwd root

How to disable root user account

sudo passwd -l root

How to allow root user to login into Gnome

System -> Administration -> Login Window-->Preferences
Security -> Allow local system administrator login (Checked)

How to add/edit/delete system users

System -> Administration -> Users and Groups
Users -> Add User... /Properties/Delete

or

sudo useradd jim
sudo userdel jim
  • For more info read
man usermod

How to add/edit/delete system groups

System -> Administration -> Users and Groups
Groups -> Add Group.../Properties/Delete

How to automatic login into GNOME

System-->Administration-->Login Window
Security-->Enable Automatic Login

Choose a user from the drop-down menu.

How to allow more sudoers

EDITOR=gedit sudo visudo
  • Append the following line at the end of file
system_username	ALL=(ALL) ALL


or, since everyone in the admin group can use sudo:

sudo adduser a_username admin

This appends the admin group to the user's supplementary group list. They will now have sudo access.

How to use "sudo" without prompt for password (not secure)

EDITOR=gedit sudo visudo
  • Find this line:
system_username	ALL=(ALL) ALL
  • Replace with this line:
system_username	ALL=(ALL) NOPASSWD: ALL

How to kill the "sudo" session

sudo -K

How to change files/folders permissions

Right click on files/folders -> Properties
Permissions Tab -> Read/Write/Execute (Checked the permissions for Owner/Group/Others)

How to change files/folders ownership

sudo chown system_username /location_of_files_or_folders

If you want to change ownership of all containing files and folders recursively, use the -R option like this:

sudo chown -R system_username /location_of_files_or_folders

How to change files/folders group ownership

sudo chgrp system_groupname /location_of_files_or_folders

If you want to change group ownership of all containing files and folders recursively, use the -R option like this:

sudo chgrp -R system_username /location_of_files_or_folders