The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do i change to super user then revert back to ordinary user ,using shell script? wrapster Shell Programming and Scripting 3 06-04-2008 04:11 AM
Run the script from another user Krishnaramjis Shell Programming and Scripting 4 11-01-2007 10:34 PM
Running script from other user rather than login user rawatds Shell Programming and Scripting 2 08-25-2006 12:51 AM
Have script run as a different user mikey20 Shell Programming and Scripting 1 11-04-2005 11:12 AM
log out user in script whatisthis Shell Programming and Scripting 6 04-25-2005 10:26 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2002
Registered User
 

Join Date: Jun 2002
Posts: 60
another user script

Hi,
Suppose I am user1 and I want to call a script using user2 (i.e., as if I call it while I am user2). However, I want to specify user2 password progromatically (without requiring user1 to enter it). Is this possible?
Thank you in advance
Best Regards
Forum Sponsor
  #2  
Old 09-22-2002
cerberusofhate
Guest
 

Posts: n/a
Check out expect, located at:expect.nist.gov .
  #3  
Old 09-24-2002
Registered User
 

Join Date: Jul 2002
Posts: 25
These can be possibilities

1)set 'Set user-id' bit to user2 script.So that when u run user2.scr
while login as user1 still it runs as if user2 is executing it.

I am not sure whether it creates file etc where user1 has no permission..

for e.g. chmod 4755 user2.scr

2)Dynamically create .netrc file and rexec the user2 script


GOOD LUCK
  #4  
Old 09-25-2002
Registered User
 

Join Date: Jun 2002
Posts: 60
Thank you very much
  #5  
Old 09-26-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
can't assign SUID to a shell script

I didn't think you can use SUID for a shell script?

I believe that you can setup "sudo" privledges for the other user. Here are a few posts that may help.

Changing effective user

Stciky bits


__________________
My brain is your brain
  #6  
Old 09-26-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Re: can't assign SUID to a shell script

Quote:
Originally posted by Kelam_Magnus
I didn't think you can use SUID for a shell script?
For years that was true because suid shell scripts opened up a security hole that could not be closed. But now some unix versions have a /dev/fd psuedo filesystem which enables this hole to be closed. Recent SunOS versions fall into this category and they support suid shell scripts.

It surprised me too.
  #7  
Old 10-04-2002
Registered User
 

Join Date: Apr 2002
Posts: 53
How abt trying to add an entry in /etc/inetd.conf for the script to be invoked under user2, and Start a program from user1 which will make an inetd connection to the inetd port of user2's script entry. You dont need the user2's passwd in this case.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0