User Management
User Management
1. Root account: This is also called superuser.A superuser can run any commands without any restriction.
2. System accounts:These accounts are usually needed for some specific function on your system. ex. sshd, mailserver ...
3. User accounts:User accounts provide interactive access to the system for users and groups of users.
#cat /etc/passwd => display the user account and password information.
#cat /etc/group => display the group information for each account.
UID:
UID 0 – reserved for the user root
UID 0-99 – reserved for the system user accounts
UID 100-499 – used for special system users
GID:
Group ID 0 reserved for root group.
Group ID range 1-99 user service and program groups.
Group ID 100 for normal users group.
Normal groups start from ID 101
Command Description
u - unique id number
s - to change a shell
Note : /sbin/nologin - user can't login from the PC, but he can
login from remote PC
[root@desktop17 ~]#
[root@desktop17 ~]#
[root@desktop17 ~]#
Delete a User
Note : The user is deleted, But the content is available in Home directory
or
Group Administration
G - Group Name
m - Create home directory
Add number of existing users into a group along with primary group
Remove a Group
Group Administration
G - Group Name
m - Create home directory
or
Add number of existing users into a group along with primary group
Remove a Group
Note
aleem:x:500:500:syed aleem:/home/aleem:/bin/bash
aleem:redhat:16387:0:99999:7:::
[root@localhost ~]#
Model II
#useradd s1
#useradd s2
#useradd m1
#useradd m2
#groupadd sales
#groupadd market
#usermod -G sales s1
#usermod -G sales s2
#usermod -G market m1
#usermod -G market m2
#cat /etc/group
[root@server ~]#
[root@server ~]#
velu:x:1107:1107::/home/velu:/bin/bash
# file: data
# owner: root
# group: market
user::rwx
user:s1:---
user:velu:rwx
group::rwx
mask::rwx
other::rwx
[velu@server data]$ ls
a b c
[velu@server data]$
sudo user
#visudo
:wq
veritas:x:1109:1101::/home/veritas:/bin/bash
mickel:x:1110:1110::/home/mickel:/bin/bash
#
group permission
backup of a us
scenarios
solution
#pwsc
#vim /etc/pam.d/password-auth
Now write these lines just above the line stating auth sufficient pam_unix.so:
Now the account will be locked after three failed login attempts.
If you don t use this parameter then you ll have to manually unlock a locked account using
lock_time=100 will lock the account for 100 seconds after failed attempts to login.
Copying the .pub files content from source server to target server.