- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- about setuid
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 04:55 AM
04-10-2005 04:55 AM
i have a problem
i write a simple script run only under user root. this is the script.(lvdisplay /dev/vg00/lvol1).
i want to make user kamal able to run this script.
i do the following:
login as root
chmod 4777 DBstat
the result is
-rwsrwxrwx 1 root sys 26 Apr 10 18:13 DBstat
but when tryed to execute script under user kamal i receive error
DBstat: lvdisplay: not found.
please expalin why this error ?
note :script works good under root user.
thankx
kamal
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:21 AM
04-10-2005 06:21 AM
Re: about setuid
01. I do not think setuid works for shell scripts it is only for binary executables
02. Please never ever keep a setuid script with 777 i.e. any tom can change & run it and can blow up your system.
03. I normally ask my software peer to write a program in C and compile it and then set the permission as 750 and the group would be the user's group.
04. sudo works best here and easy as well
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:22 AM
04-10-2005 06:22 AM
Re: about setuid
PATH=${PATH}:/usr/sbin
export PATH
inside your script.
I must say that having a setuid script with 4777 mode is really, really dumb. Anyone can alter this script and do great damage. At the very least, change the permissions to 4555 so that no one can write to this file.
Setuid scripts, in general, are a terrible security risk and should be avoided. Use sudo to do this instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:27 AM
04-10-2005 06:27 AM
Re: about setuid
sorry
i forget change path.
now every thing is ok
but
when i tryed to change my script to execute command (useradd).
i recieved messege : Permission Denied
also i setuid
what is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:31 AM
04-10-2005 06:31 AM
Re: about setuid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:38 AM
04-10-2005 06:38 AM
Re: about setuid
/usr/sbin/useradd.
-r-xr-xr-x 1 bin bin 53248 May 12 1998 useradd.
and my script file :
-rwsr-xr-x 1 root informix 76 Apr 10 20:22 DBstat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 06:45 AM
04-10-2005 06:45 AM
Re: about setuid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 07:07 AM
04-10-2005 07:07 AM
Re: about setuid
there is something i can't understand it.
my login name is kamal.
when i tryed to execute command (useradd).
i recieved messege : Permission Denied.
i goto /usr/sbin and make the following :
1-chown root useradd
2-chmod 4755 useradd
now i can execute command useradd under my user.
but the problem is any user can execute this command also.
when i tryed before to put this command in file .and setuid to this file to root.
i recieved messege :permission denied.
i want to leave file useradd without any changes . and make file contain command (useradd) and setuid to this file.
is that possipole?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 12:36 PM
04-10-2005 12:36 PM
Re: about setuid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2005 08:14 PM
04-10-2005 08:14 PM
Re: about setuid
can i write script contain one command executed only by root(for ex: useradd)
and setuid for this script.
and run this script under any user except root?
i tryed to do that but i recieved messege :
permission denied.
is there any thing i gorget?
thankx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2005 02:11 AM
04-11-2005 02:11 AM
Re: about setuid
sudo
sudo
sudo
You have already tweaked the os binaries and their permissions , never do that..
for others, does setuid work for shell scripts ?
Regds,
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2005 02:19 AM
04-11-2005 02:19 AM
Re: about setuid
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2005 02:55 AM
04-11-2005 02:55 AM
Re: about setuid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2005 10:01 AM
04-11-2005 10:01 AM
Re: about setuid
I would suggest that you consdier the Restricted Sam builder. You can add a script to be executed by sam using whatever userid and you can add scripts or programs to sam and specify what userid can run specific entries in sam. It is a good functionality that provides full logging.