- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to pass password to "su" as a parameter within...
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-23-2003 11:41 PM
07-23-2003 11:41 PM
I need to add an entry to the /etc/services file while running a shell script as a normal user. But I don't want su to prompt me for the root password instead it can be passed on to the shell script by a GUI interface(I can make this interface not to display the password). Or I can accept the password as an argument to the script.
The shell script can add desired entries to the services file and then exit.
Can somebody out there help me?
Thanks in advance
Regards
Binu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 12:02 AM
07-24-2003 12:02 AM
Re: How to pass password to "su" as a parameter within a shell script?
Try sudo
A method of using root commands is with the program called sudo. Information is available at:
www.courtesan.com/sudo/
Please note that Hewlett-Packard does not support sudo.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 12:09 AM
07-24-2003 12:09 AM
Solutionhttp://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA
or
create a setuid executable, whose only function is to add/remove that service.
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 12:50 AM
07-24-2003 12:50 AM
Re: How to pass password to "su" as a parameter within a shell script?
You can download a thirdparty tool called expect using this you can pass the password to su or password command.
-Rajesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 01:38 AM
07-24-2003 01:38 AM
Re: How to pass password to "su" as a parameter within a shell script?
Create a little script that belongs to root and group admin ( for example ). your user belongs to group admin, too. This little script will add your line to /etc/services.
Then set the s-Bit on that script.
#ll myscript.sh
-rw-r--r-- 1 root admin 123 Jul 24 10:55 myscript.sh
#chmod 550 myscript.sh
# chmod g+s myscript.sh
#ll myscript.sh
-r-xr-s--- 1 root admin 123 Jul 24 10:55 myscript.sh
And now you can use this script in your main script.
Roland