Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change group 1

Status
Not open for further replies.

bhawani123

IS-IT--Management
Nov 1, 2000
152
IN
Hello guys,

I am working in different group and my primay group is set
to ibll(group name) and Another group name are(pci,pcix,hrd.
when I give the command id it show my user name and primary
group name and when I give groups command It display the all
groups name there I am member of those group.
my Question is when i creat any file or directory it automatically creat this file in primary group.
how will I creat file or directory in another group if I am working with secondary group?(automatically secondry group name shuold be appear If I creat new file or directory)

Regd,
Ajay lohani
 
After logging in use 'newgrp' to change your id to anothe rgroup. All files you create will now belong to newgrp.

See man page on newgrp
 
Thanks it is working.Now I want to assign password for
group.please tell me how to assign passwd to group.

Regd,
Ajay
 
From the man page for newgrp ...

A password is demanded if the group has a password and the user is not listed in /etc/group as being a member of that group. The only way to create a password for a group is to use passwd(1), then cut and paste the password from /etc/shadow to etc/group. Group passwords are antiquated and not often used.

Greg.
 
Thanks grega,

Thanks,I checked it.It is working but we can take user
password from /etc/shadow.I have 10 number of group and I can assign only same password to all group.
But it is dangerous for security reason.

Regd,
Ajay lohani
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top