The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Security
.
google unix.com



Security Discuss UNIX and Linux computer and network security, cybersecurity, cyberattacks, IT security, CISSP, OWASP and more.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing user password mayge AIX 0 07-12-2006 12:08 PM
Changing user profile - Newbie question panchopp AIX 1 03-24-2006 04:54 PM
Hostname lost when changing user Pablo_BR UNIX for Dummies Questions & Answers 4 01-31-2006 08:52 PM
Changing the Effective Group ID Jody UNIX for Dummies Questions & Answers 2 12-05-2002 03:53 PM
Changing permissions of a user achink125 UNIX for Advanced & Expert Users 3 06-03-2002 03:11 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2001
hilmel hilmel is offline
Registered User
  
 

Join Date: Sep 2001
Location: Norway
Posts: 1
Changing effective user

I would like to give execution rights for a script to one user. (that's the easy part...)
When that user is running the script, I would like the effective user ID to be that of the file-owner. Is this possible?
  #2 (permalink)  
Old 09-18-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Yes, try looking up the manpage for chmod. What you want is to set the "sticky bit" on the file.

It may be a little tricky to get the script only executable by only one person and to have it set uid, but it can be done through the use of groups.
  #3 (permalink)  
Old 09-18-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
oops

In many cases, modern shells will not let you run a script setuid, only a binary...

You might need another way.

Any suggestions from anyone?
  #4 (permalink)  
Old 09-18-2001
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
It suid bit controls the switch of the effective uid. The sticky bit has nothing to do with it. And modern kernels will ignore the suid and sgid bits when executing scripts.

There is a program called "sudo" that can let a user run a script with another uid's authority. That is what I would recommend. sudo is a public domain program available from various archive sites.
  #5 (permalink)  
Old 09-19-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Oops, I got +t and +s mixed up again...
Probably not a good thing to do very often, no?
  #6 (permalink)  
Old 12-05-2001
raleman raleman is offline
Registered User
  
 

Join Date: Dec 2001
Location: Mexico City
Posts: 1
Unhappy Where could i find "sudo"

Does anybody knows were could i find this "sudo" program or could point me on an easy way to execute commands inside a script being a different user.



Quote:
Originally posted by Perderabo
It suid bit controls the switch of the effective uid. The sticky bit has nothing to do with it. And modern kernels will ignore the suid and sgid bits when executing scripts.

There is a program called "sudo" that can let a user run a script with another uid's authority. That is what I would recommend. sudo is a public domain program available from various archive sites.
  #7 (permalink)  
Old 12-06-2001
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
http://www.courtesan.com/sudo/

If you want to log in to another server within a script (I have a feeling this will be the next question) , and as long as you're not too worried about security, check out http://expect.nist.gov for Expect and samples. Also, search this site for .netrc .

Have fun!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0