User Permission Overwrite Group Permissin on Linux
This is a tricky question when my customer ask me why he can’t change certain on his home folder.
Said for an example:
I have a username: john with primary group finance running on one of the Linux server.
$id john
uid=1008(john) gid=1002(finance) groups=1002(finance)
$pwd
/home/john
$ls -l aug2008.txt
-r-rw-r– 1 john finance 1168 2008-08-16 11.30 aug2008.txt
The problem is here:
When a user called john login to Linux box and he tried to edit file aug2008.txt using vi or any other editor, he will getting a READ ONLY error.
Read more
Possibly Related Posts:
- How to add Dell PERC Drivers into VMware Converter Cold Clone ISO
- Top 10 Free Anti Virus
- How to Install Webmin on OpenFiler
- Microsoft SQL 2008 Agent not starts
- VMware Workstation 7 Serial Key
How To Add Linux User To Group
All Linux users have a user ID and a group ID and a unique numerical identification number called a userid (UID) and a groupid (GID) respectively. Groups can be assigned for a single user or a group or users together for a common security, privilege and access purpose.
/etc/group is an ASCII file which defines the groups to which users belong. There is one entry per line, and each line has the format:
group_name:passwd:GID:user_list
The field descriptions are: group_name – the name of the group. password – the (encrypted) group password. If this field is empty, no password is needed. GID – the numerical group ID. user_list – all the group member’s user names, separated by commas. There are two types of group, first is primary user group and other is supplementary group. How to create Linux ‘Admin’ group? Type:
#groupadd admin
How to add a new Linux user ‘eric’ to primary group ‘admin’? Type:
#useradd -g admin eric
#id eric
uid=1000(eric) gid=1000(admin) groups=1000(admin)
How to add a new Linux user to supplementary group1,group2 and group3? Type:
#useradd -g admin -G group1,group2,group3 user
OR
#id user
uid=1289(user) gid=1000(admin) groups=1000(group1),1001(group2),1002(group3)
Edit /etc/default/useradd file and add
GROUPS=group1,group2,group3
Save
#useradd user -g admin
#id user
uid=1289(user) gid=1000(admin) groups=1001(group1),1002(group2),1003(group3)
Possibly Related Posts:
- How to add Dell PERC Drivers into VMware Converter Cold Clone ISO
- Top 10 Free Anti Virus
- How to Install Webmin on OpenFiler
- Microsoft SQL 2008 Agent not starts
- VMware Workstation 7 Serial Key