Here is my situation. On a RedHat 7.3 box, I have a user named jody.
When I log in with jody and type in "id", I get the expected output:
uid=1(jody) gid=1(jody) groups=1(jody), 510(test)
However, I cannot figure which "id" option allows me to change the effective gid. I tried the options given to me in the help menu and the man pages, but that did not work. Am I completely off-base by expecting "id" to allow me to change the effective gid from 1(jody) to 510(test)?
The id command displays your id, it doesn't alter it. The newgroup command changes your group id, not the effective group id.
If you really want to change the effective gid (which does not really make any sense), try the following commands. You will need to use a valid group on your system and maybe a different shell than ksh...
cp /usr/bin/ksh /tmp
chgrp nuucp /tmp/ksh
chmod 2555 /tmp/ksh # this may require root to work
/tmp/ksh
id
You should see "egid=nuucp(11)" or something like that depending on what group you used.
The su command is owned by root and has permissions of 4555 which makes it suid to root. So you can run it as an ordinary user but it can take actions that require root power. While the su command is running, the uid is your account and euid is root. The egid is similiar. You probably have some sgid programs and "find /usr/bin -perm -2000 -perm" will find them.
Originally a process could have only one group at a time. And you used newgroup to change your group. BSD introduced multiple groups, so now a process can be in many groups. After that the newgroup command wasn't used anymore. HP-UX supports both schemes. But most HP-UX users go with the multiple group at once scheme.