- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- su newuser password in 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
Discussions
Discussions
Forums
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
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
тАО09-28-2001 09:56 AM
тАО09-28-2001 09:56 AM
su newuser password in shell script
su - newuser in my shell script.
The script is started under my username and I want to su to the application user account within my shell script but I'm not sure how to input the newuser password.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2001 10:02 AM
тАО09-28-2001 10:02 AM
Re: su newuser password in shell script
This isn't possible in pure shell script. The 'su' expects to offer you an interactive query for the password.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2001 10:04 AM
тАО09-28-2001 10:04 AM
Re: su newuser password in shell script
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x9fd0f841489fd4118fef0090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2001 11:11 AM
тАО09-28-2001 11:11 AM
Re: su newuser password in shell script
Su being interactive, noluck for normal user to login in to another users.
Try some suid programs instead.
If you are suing to app id to run app. programs only, why not set suid on that program.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2001 03:25 AM
тАО09-29-2001 03:25 AM
Re: su newuser password in shell script
I do not think this is possible with "su".
Try rexec, remsh or rlogin "localhost" !
There are several ways to authenticate without a password for these programs. I favor rexec with a .netrc file for this.
Keep in mind, that you might need to call a script, that sources the profiles/loginscripts first, because rexec and remsh do not do this.
Hope this helps
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2001 03:59 AM
тАО09-29-2001 03:59 AM
Re: su newuser password in shell script
you might want to try working with a simular GID. I suppose that is what there are intended for. If you have problems whith env. settings you can add the env in the script you are runnen. If thats not possible i suggest an r.... command.
Good luck
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2001 02:15 PM
тАО09-29-2001 02:15 PM
Re: su newuser password in shell script
get yourself a copy of "expect" installed.
Then you can issue that password through "expect".
That's the only (simple) way I can think of (at 00:17h
at night ;-).
HTH,
Wodisch