Sponsored Content
Full Discussion: UNIX group id
Special Forums Cybersecurity UNIX group id Post 302554983 by jim mcnamara on Tuesday 13th of September 2011 02:10:45 PM
Old 09-13-2011
I think I get what you want.

You want to login as user A, but automatically become user B, and stay user B.
When then this weird user logs out he just logs out and is never really user A. Right?
Simply giving user A the same group id as User B will not do what you want. -- assuming I understand what you want.

Here is the very insecure quick version for solaris, run as root (change directory names to work for you):
Code:
# user needs to be in a group all by himself
groupadd weird
mkdir -p /export/home/userA
useradd -g weird -d /export/home/userA -c 'odd user' -s /bin/ksh -P 'Primary Administrator' userA
chown userA:weird /export/home/userA

Give userA a password.

next create a login .profile for userA that looks like this:
Code:
pfexec su - userB
exit

next
Code:
cp .profile /export/home/userA
chmod 444 /export/home/userA/.profile
chown root:root /export/home/userA/.profile

If you really need this, consider learning about RBAC for Solaris, instead of this hack.
Blastwave.org - An OpenSolaris Community Site has sudo for Solaris, which is a quicker way to get fine control over something like tihs.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to define permission of unix group

While logged on as root, I created a user 'usera' I also created a group called 'groupa' I need to modify the permission of the user i created to not have root privileges. I also need to change groupa to be in 'others' please help! thanks, nieves (3 Replies)
Discussion started by: mncapara
3 Replies

2. UNIX for Dummies Questions & Answers

listing members of a unix group

I know there is a "groups" command to list the groups a user belongs to, but how about the opposite? Is there a standard command to find out which users belong to a particular group? (2 Replies)
Discussion started by: ovaska
2 Replies

3. Solaris

unix group file limitation

Does anyone know how to get around the unix group file limitation whereby you have a limit of 1024 characters when adding users to a unix group? (3 Replies)
Discussion started by: asmillie
3 Replies

4. Shell Programming and Scripting

Achieving group by logic via Unix

HI friends, select count(*),country_code from employees_table group by country_code having com_country_code in ("US","UK") CAn we have an equivalent command in Unix to achieve this Thanks in advance Suresh (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

5. Shell Programming and Scripting

create group in unix

Hi, I want to create group in unix. what is the command? how to create a group and add a user into that group? Thanks in advance (2 Replies)
Discussion started by: senthil_is
2 Replies

6. UNIX for Dummies Questions & Answers

Portland UNIX student group

In CS140 .... I am having a very hard time with lab 4. I am wondering if we could put together a study group in portland. This could help all of us. Post here and I will PM you my # and we can set it up over the phone. (0 Replies)
Discussion started by: aeamacman
0 Replies

7. Shell Programming and Scripting

Group By in Unix

Hi, I have file with Header Data and trailer records Head|currentdate|EOF Data|AAA|BBB|CCC|DDD|EEE|Source1 Data|AAA|BBB|CCC|DDD|EEE|Source1 Data|AAA|BBB|CCC|DDD|EEE|Source2 Data|AAA|BBB|CCC|DDD|EEE|Source2 Data|AAA|BBB|CCC|DDD|EEE|Source2 End|rec|EOF Now I need the count of only... (3 Replies)
Discussion started by: magesh_bala
3 Replies

8. UNIX for Advanced & Expert Users

Adding UNIX user to a group

Hi, I am new to unix. I am facing access permission issue I want to access path /app/compress from a user "test" but getting permission denied error This path exist in "Main" user So after some googling i came to know we need to add "test" user in "main" group so path /app/compress ... (7 Replies)
Discussion started by: sv0081493
7 Replies

9. Shell Programming and Scripting

Group by in UNIX

Hi team i have input file name,dep,sal xxx,1,100 yyy,2,,200 zzz,1,3000 eeee,1,200 ttttt,2,500 zzz,2,123 xyxy,3,1000 and output i require as below i.e highest value from colum3 grouping bydep, with all three columns name,dep,sal name,dep,sal zzz,1,3000 ttttt,2,500 xyxy,3,1000 (3 Replies)
Discussion started by: zozoo
3 Replies

10. Shell Programming and Scripting

To group records in the file in UNIX

Hi All, I am using RHEL 6.9. I got a requirement to group the records in a file.The file content as shown below. #### FAILED JOBS IN XXX ##### 1> ABCD failed in the project XXX 2> HJK Job is in compiled state in the project XXX 3> ILKD failed in the project XXX 4> DFG failed in the... (5 Replies)
Discussion started by: ginrkf
5 Replies
pam_xauth(8)						   System Administrator's Manual					      pam_xauth(8)

NAME
pam_xauth - forward xauth keys between users SYNOPSIS
session optional /lib/security/pam_xauth.so arguments DESCRIPTION
pam_xauth.so is designed to forward xauth keys (sometimes referred to as "cookies") between users. Without pam_xauth, when xauth is enabled and a user uses the su command to assume another user's priviledges, that user is no longer able to access the original user's X display because the new user does not have the key needed to access the display. pam_xauth solves the problem by forwarding the key from the user running su (the source user) to the user whose identity the source user is assuming (the target user) when the session is created, and destroying the key when the session is torn down. This means, for example, that when you run su from an xterm sesssion, you will be able to run X programs without explicitly dealing with the xauth command or ~/.Xauthority files. pam_xauth will only forward keys if xauth can list a key connected to the $DISPLAY environment variable. Primitive access control is provided by ~/.xauth/export in the invoking user's home directory and ~/.xauth/import in the target user's home directory. If a user has a ~/.xauth/import file, the user will only receive cookies from users listed in the file. If there is no ~/.xauth/import file, the user will accept cookies from any other user. If a user has a .xauth/export file, the user will only forward cookies to users listed in the file. If there is no ~/.xauth/export file, and the invoking user is not root, the user will forward cookies to any other user. If there is no ~/.xauth/export file, and the invoking user is root, the user will not forward cookies to other users. Both the import and export files support wildcards (such as *). Both the import and export files can be empty, signifying that no users are allowed. ARGUMENTS
debug Turns on debugging messages sent to syslog. xauthpath=/usr/X11R6/bin/xauth Specify the path the xauth program (the default is /usr/X11R6/bin/xauth). IMPLEMENTATION DETAILS
pam_xauth will work only if it is used from a setuid application in which the getuid() call returns the id of the user running the applica- tion, and for which PAM can supply the name of the account that the user is attempting to assume. The typical application of this type is su. The application must call both pam_open_session() and pam_close_session() with the ruid set to the uid of the calling user and the euid set to root, and must have provided as the PAM_USER item the name of the target user. pam_xauth calls xauth as the source user to extract the key for $DISPLAY, then calls xauth as the target user to merge the key into the a temporary database and later remove the database. pam_xauth cannot be told not to remove the keys when the session is closed. SEE ALSO
/usr/share/doc/pam*/html/index.html FILES
~/.xauth/import ~/.xauth/export BUGS
Let's hope not, but if you find any, please report them via the "Bug Track" link at http://bugzilla.redhat.com/bugzilla/ AUTHOR
Nalin Dahyabhai <nalin@redhat.com>, based on original version by Michael K. Johnson <johnsonm@redhat.com> Red Hat Linux 2001/9/27 pam_xauth(8)
All times are GMT -4. The time now is 04:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy