- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: su command in "SUID" script
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
07-01-2002 10:40 AM
07-01-2002 10:40 AM
When I try to execute su command from a shell script with SetUserID bit set it asks for the password. Is it posible to avoid it?
The script:
---------------------------
$ cat prog.sh
#!/usr/bin/sh
set -x
id
su oracle -c "pwd"
---------------------------
The permissions:
$ ll
total 2
-r-sr-xr-x 1 root sys 48 Jul 1 14:29 prog.sh
---------------------------
The execution:
$ ./prog.sh
+ id
uid=250(patrol) gid=200(sybadm) euid=0(root)
+ su oracle -c pwd
Password:
su: Sorry
---------------------------
I don't need the "Password:" prompt!!!!
Thanks,
Troy.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 10:48 AM
07-01-2002 10:48 AM
Re: su command in "SUID" script
From my understanding, only root can bypass password when running the su command.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 10:52 AM
07-01-2002 10:52 AM
Re: su command in "SUID" script
You mightr consider sudo or writing a setuid wrapper in C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 11:00 AM
07-01-2002 11:00 AM
Solutionhttp://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.6/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 11:57 AM
07-01-2002 11:57 AM
Re: su command in "SUID" script
I use Sudo for a number of such tasks but even with sudo I am still getting the user to enter a password to verify and I am not sure you can stop this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2002 12:02 PM
07-01-2002 12:02 PM
Re: su command in "SUID" script
Did you try with NOPASSWD entry in sudoers file? That will help you to skip the passwd when you use sudo...