User Management Commands in Linux /****
User Management in Linux
A user is an entity, in a
Linux operating system, that can manipulate files and perform several other
operations. Each user is assigned an ID that is unique for each user in theoperating system. In this post, we will learn about users and commands which
are used to get information about the users. After installation of the
operating system, the ID 0 is assigned to the root
user and the IDs 1 to 999 (both inclusive) are assigned to the
system users and hence the ids for local user begins from 1000 onward.
In a single directory, we can create 60,000 users.
User Management Command
User
management is nothing but adding, deleting the users and assigning the
passwords for the users in Linux. The same follows with groups. The important
thing is this command needs root privilege for accessing other users or groups.
Only the same user process can be done without the privilege.
Changing user’ s home directory
To
change the user’ s default home directory to a different location, use the
following User management command.
Syntax
user mod --home [new home directory path] [username]
Example
[root@linuxhelp ~]# usermod --home
/home/user1/Desktop/
Disabling user by locking password
The
user account can be disabled by locking the user’ s password.
Syntax
user mod --lock [username]
Example
[root@linuxhelp ~]# usermod --lock user1
The
options -L or --lock can be used to lock the user’ s password.
Unlocking user password
To
unlock a user password, use the following User management command.
Syntax
usermod --unlock [username]
Example
[root@linuxhelp ~]# usermod --unlock user1
Comments
Post a Comment