Thursday, July 27, 2017

linux - How to automatically reconcile /etc/group and /etc/gshadow




Running grpck to check the groups, I see these errors:



 'twinky' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'dipsy' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'laalaa' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'po' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'noonoo' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
'dipsy' is a member of the 'foo' group in /etc/group but not in /etc/gshadow
...



...and on for quite a few. I'm not sure how this happened, and I'd like to get it cleaned up. I know I could manually edit the /etc/gshadow, but I'd rather let the OS do it, to prevent typos and manual labor.



Is there anything that can automatically reconcile a group into gshadow? Maybe something like (making this up):



# grpfix foo


I've tried man on various group-related commands and googled around, but so far I haven't been able to find the answer.



Answer



man had the answer I missed before:



grpconv


http://linux.die.net/man/8/grpconv:




The grpconv command creates gshadow from group and an optionally existing gshadow.




No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...