Sponsored Content
Top Forums Shell Programming and Scripting switch as another user without password Post 302519863 by purdym on Thursday 5th of May 2011 08:49:22 AM
Old 05-05-2011
Some random thoughts....

Do you have to log in as user 'u2'? Can you do what you want with groups?

Can you use owner or group set UID / GID on an executable?
Could you use SUID and sudo on an executable?

If not, another vote for sudo.

What do you want to do as user u2?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Non-interactive user switch to root

Is is possible switch user from a non-root user to root user without entering the password interactively inside a korn shell script which is run by a non-root user? e.g. I have a non-root user called infodba who is in dba group and I want to create a shell script which is executed by infodba... (5 Replies)
Discussion started by: stevefox
5 Replies

2. UNIX for Advanced & Expert Users

Switch user :NOPASSWD setting

Hi All, I want trigger a script "abhishektest.sh "whenever a mail come to a user say "abhishek" in my unix server. I dont have root permission. So, for doing this i added abhishek : "|/export/abhishek/bin/wr_test.sh in /etc/mail/aliases in wr_test file : i need to put this line, as i... (2 Replies)
Discussion started by: mindtee_abhi
2 Replies

3. UNIX for Dummies Questions & Answers

Expect command to switch user

Hi I have written a script to switch user and do some operations. I used expect command it doesn't work. It switches the user and waits for the Password to be entered manually. Also, i tried to fetch the pasword from passwd file, it didn't work.The script is as below: ... (4 Replies)
Discussion started by: Sapna_Sai
4 Replies

4. Shell Programming and Scripting

Switch to different user without expect

Hi, I have to switch to a different user and execute certain commands and then come back to the original user Ex: My id is 'usstage'. I need to switch to 'apstage', souce a script there, execute a function and then get back again to usstage. Please note that I do not have expect installed... (4 Replies)
Discussion started by: sugan
4 Replies

5. AIX

Switch user(su) two times

Is it possible to switch to root(if allowed) and then with root privileges switch to another user account "ABC"? To further explain the scenario, ABC is an account which has sugroups=su2DEF and root is not part of su2DEF group. but, given that root can switch to any account(correct me if I am... (7 Replies)
Discussion started by: mtwain
7 Replies

6. Shell Programming and Scripting

switch user from local user to root in perl

Hi Gurus, I have a script that requires me to switch from local user to root. Anyone who has an idea on this since when i switch user to root it requires me to input root password. It seems that i need to use expect module here, but i don't know how to create the object for this. ... (1 Reply)
Discussion started by: linuxgeek
1 Replies

7. Shell Programming and Scripting

How to switch user using shell script ?

Hi, script1.sh script2.sh script3.sh From above, script1.sh is the main script which is executed from root user, creates installation directory, changing ownership and execution rights etc..etc.. and finally calls scripot2.sh and script3.sh to create the database as well as for post... (1 Reply)
Discussion started by: milink
1 Replies

8. Shell Programming and Scripting

Switch user without password inside shell

I want to switch to another user without password inside shell. I used the below command and it is not working. sudo su - user1 user1 is not in the sudoers file. This incident will be reported. I'm getting the above message. If I want to add user1 into the sudoers file using... (5 Replies)
Discussion started by: Roozo
5 Replies

9. Shell Programming and Scripting

Switch user terminal error

Hello All, Here I am trying to login a Linux machine as admin user from a Solaris box.. & then switch to root user.. Code I use: ssh admin@<IP> << END su - root << A echo "Hello I am logged in as root" exit A exit END But the error I get.. su: must be run from a... (3 Replies)
Discussion started by: ailnilanjan
3 Replies

10. Shell Programming and Scripting

How to Switch from Local user to root user from a shell script?

Hi, I need to switch from local user to root user in a shell script. I need to make it automated so that it doesn't prompt for the root password. I heard the su command will do that work but it prompt for the password. and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies
PTS_LISTOWNED(1)					       AFS Command Reference						  PTS_LISTOWNED(1)

NAME
pts_listowned - Show the Protection Database groups owned by a user or group SYNOPSIS
pts listowned -nameorid <user or group name or id>+ [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts listo -na <user or group name or id>+ [-c <cell name>] [-no] [-l] [-f] [-h] DESCRIPTION
The pts listowned command lists the groups owned by each user or group specified by the -nameorid argument. To list any orphaned groups, whose owners have themselves been deleted from the Protection Database, provide a value of 0 (zero) for the -nameorid argument. To change the owner to a user or group that still exists, use the pts chown command. OPTIONS
-nameorid <user or group name or id>+ Specifies the name or AFS UID of each user, or the name or AFS GID of each group, for which to display the list of owned groups. It is acceptable to mix users and groups on the same command line, as well as names and IDs. Precede the GID of each group with a hyphen to indicate that it is negative. A value of 0 (zero) lists group entries for groups whose owners no longer have entries in the Protection Database. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). OUTPUT
The first line of the output indicates the name and AFS UID or AFS GID of each user or group for which ownership information is requested, in the following format: Groups owned by <name> (id: <ID>) are: A list of groups follows. The list does not include groups owned by groups that the user or group owns, or to which the user or group belongs. If the user or group does not own any groups, only the header line appears. The following error message appears if the issuer is not privileged to view ownership information. By default, for both user and group entries the second privacy flag is the hyphen, which denies permission to anyone other than the user (for a user entry) and the members of the system:administrators group. pts: Permission denied so failed to get owner list for <name> (id: <ID>) EXAMPLES
The following example lists the groups owned by user terry and shows that the group "terry:friends" does not own any groups: % pts listowned terry terry:friends Groups owned by terry (id: 1045) are: terry:friends terry:project1 terry:project2 Groups owned by terry:friends (id: -673) are: PRIVILEGE REQUIRED
The required privilege depends on the setting of the second privacy flag in the Protection Database entry of each user or group indicated by the -nameorid argument (use the pts examine command to display the flags): o If it is the hyphen and the -nameorid argument specifies a group, only the members of the system:administrators group and the owner of a group can list the groups it owns. o If it is the hyphen and the -nameorid argument specifies a user, only the members of the system:administrators group and the associated user can list the groups he or she owns. o If it is uppercase letter "O", anyone who can access the cell's database server machines can list the groups owned by this user or group. SEE ALSO
pts(1), pts_chown(1), pts_examine(1), pts_setfields(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_LISTOWNED(1)
All times are GMT -4. The time now is 11:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy