The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-17-2007
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Another way: You may set the SUID bit to those programs, owned by the user you want them to be run as. So, if you have programe1 and programe2, and want them to be run as user1 then:

Code:
user2> ls -l programe1 programe2
-rwsr-xr-x   1 user1     user1            0 Jan 17 11:26 programe1
-rwsr-xr-x   1 user1     user1            0 Jan 17 11:26 programe2
user2> ./programe1

I do not kike to use SUID unless it's necessary, but it's a possible and easy solution.