![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| su root from normal user | karthikn7974 | Shell Programming and Scripting | 0 | 04-24-2008 10:16 PM |
| user commands without root access | emealogistics | HP-UX | 1 | 05-27-2007 12:04 AM |
| switching between root and a normal user | melanie_pfefer | Shell Programming and Scripting | 3 | 04-21-2007 08:02 AM |
| Capture of all commands issued by the user “root” | elieifrah@gmail | UNIX for Advanced & Expert Users | 4 | 03-19-2007 10:55 AM |
| Other than root user .Normal user is unable to create files | mallesh | UNIX for Advanced & Expert Users | 1 | 06-22-2005 01:18 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Dear all
Ihave written a script in Hpux9.0, the ecript is working fine if I run it from root command prompt But when I am running it thru /etc/profile or /user/.profile and login as a normal user, the owner of the process running the script is the normal user & hence cant run a root privileaged command so pls help how can i run that script, so that a normal user when logs in the script should start in background with root privileages. Thanks in advance Nitin M |
|
|||||
|
I just answered this on ITRC, so here's the pasted text:
This can be done with sudo. Run this command to edit the sudoers file: visudo Add something like this (for 'user1' as example): user1 ALL = NOPASSWD: /path/to/script.sh Then in the user1 .profile, add this: sudo /path/to/script.sh & This will run the command as root in the background. For more information on sudo: Sudo Main Page |
|
|||||
|
Sudo download with prepared binaries. (no 9.x though)
|
|
||||
|
Get your system administrator to change the ownership of the file to root and then change the file permissions to add the set user-ID bit. Code:
chown root filename chmod u+s filename When you 'ls' the file you'll see an output such as: Code:
-rwsrwxrw- root root filename I believe that if you then edit the script, you'll lose the s bit, as otherwise there a huge security loophole! Hope that helps. Jerry |
|
||||
|
The safe response is to create a root cron which polls for a user-generated
flag file. On finding the flag file the root cron executes the desired script and then removes the flag file. We cannot endorse upgrading the privilege of shell scripts with SUID techniques in this context. We are slightly concerned about the motives of this post. Sudo is irrelevant on HPUX 9.0, but remains a useful tool in modern OS. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|