- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- su to user too in a shell 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
03-25-2002 05:41 AM
03-25-2002 05:41 AM
su to user too in a shell script
I start a shell script as a normal user. In this script I have to execut a command with root users rights. I tested this command to run from my script with a su to user root but this doesn't work!!
Thanks for any help in advance!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 05:53 AM
03-25-2002 05:53 AM
Re: su to user too in a shell script
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 06:04 AM
03-25-2002 06:04 AM
Re: su to user too in a shell script
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/sudo-1.6.2b1/
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 06:16 AM
03-25-2002 06:16 AM
Re: su to user too in a shell script
sudo su - infa -c "cd directory;command -arguments"
I hope that this helps.
Regards,
Jason V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 07:46 AM
03-25-2002 07:46 AM
Re: su to user too in a shell script
You cannot run a script as a user and do a su to root in the script. You do not have the valid permissions. download and configrue sudo which will allow you to run some restricted (root allowed) commands as a normal user.
You can download sude from this link,
http://www.courtesan.com/
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 08:09 AM
03-25-2002 08:09 AM
Re: su to user too in a shell script
You cannot su to root from a user ,in the script alternatively you can copy the command in the users directory and mke it executable by the user unless there are other files required.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 08:24 AM
03-25-2002 08:24 AM
Re: su to user too in a shell script
to set the SUID, use:
#chmod 4755 script.sh
HTH
-Rusty