Site icon Ananova Business Web Hosting

Linux User Administration

Linux User Administration

A Linux administrator manages user accounts, their rights, and the overall system security.

Linux Account Types

A Linux group plays important role in handling file permissions and process management. Every account is a part of another group account.

User Administration Files

su
Switch user to root from current login
su-
Switch user to root from current login and load's its profile
w
List logged-in users with their session information
who
List logged-in users
whoami
Display current user
finger
Procure information of the users on a Linux machine
users
Display users currently logged in
usermod
Change properties of the specified user account
usermod -a -G [groupname] [username]
Add a user to a group

useradd -d homedir -g groupname -m -s shell -u userid accountname
adduser [username] OR
useradd [username]
Create a new user
-d homedir Specifies home directory for the account
-g groupname Specifies a group account for this account
-m Creates the home directory if it doesn't exist
-s shell Specifies the default shell for this account
-u userid specify a user id for this account
userdel -r [username]
Delete an account
userdel -r [username]
Delete an account, but keep the home directory for backup purposes
passwd [username]
Set or change the user's password
passwd -l [username]
Remove the password set on the account
groupadd [-g gid [-o]] [-r] [-f] groupname
Create a new group with a specified name
-g GID The numerical value of the group's ID
-o Permits to add group with non-unique GID
-r This flag instructs groupadd to add a system account
-f Exit with success status, if the specified group already exists
groupmod -n new_group_name old_group_name
To modify or change a group
groupdel [groupname]
To delete an existing group
groups
Display the group membership of the currently logged in user
exit
exit from the login session


Exit mobile version