How can I make bash recognise that some user has been added to a group?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Does anyone disagree that logging in is the key act to getting a newly added group recognized? It does not matter whether you want this group recognized w/in a tty, Xterm, Desktop Environment, or Window Manager -- you must log in after being added to a group in order to exercise that group's privileges.
No one knows if there is way to "reload" the /etc/group info. w/o logging out & logging back in. This is analogous to daemons, e.g. dnsmasq, that can be made to reload their config files w/o having to be shut down & restarted, let alone needing a full re-boot of the whole OS.
Although I included "tty, Xterm" in my summary for the sake of completeness, the real problem, at least for me, is w/ the GUI's, where logging out & back in is real problem: time consuming & the risks losing session info -- what web pages & what files are open in which work spaces -- that sort of thing, not to mention losing unsaved data.
We have discussed some relatively painless solutions for tty's & Xterm's. My favorite is "[sudo] su <current_user>". I believe it does not pass the current command history through; however, that can be cured by (a preceding) "history -w".
I don't use screen, so I have no idea what its problems w/ new groups might be. Given that it allows more complicated tty/Xterm sessions, this might be analogous to the GUI problem.
FWIW, I don't think that exporting $GROUPS will work, because it gets its info from /etc/group at log in.