- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "su -" from non-root to non-root same user wit...
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
05-18-2009 05:44 AM
05-18-2009 05:44 AM
su - username
from username (same account, nonroot-user) without to give the password.
can i do this too in hpux ?
if not why not ?
Thanks and regards
Olaf
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 05:54 AM
05-18-2009 05:54 AM
Re: "su -" from non-root to non-root same user without pw ?
No. You can't. HP-UX will ask the password even if you switch to same user.
>>if not why not ? <<<
Yet to find the reason :(-
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 05:55 AM
05-18-2009 05:55 AM
Re: "su -" from non-root to non-root same user without pw ?
Unless you are 'root' then 'su' will require the account target password on HP-UX.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 07:05 AM
05-18-2009 07:05 AM
Re: "su -" from non-root to non-root same user without pw ?
As others have pointed out, no you can't do this exactly as you're describing. You can get the same affect, though, by using ssh/public key authentication. There should be plenty of posts in itrc on how to set that up.
Doug O'Leary
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 08:08 AM
05-18-2009 08:08 AM
Re: "su -" from non-root to non-root same user without pw ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 09:55 AM
05-18-2009 09:55 AM
Re: "su -" from non-root to non-root same user without pw ?
The big reason, as always, would be convenience. Specfic example: SAP. su'ing from ora${sid} to ${sid}adm and back again to support oracle and the SAP instance as needed...
I'm sure there are 1000s of other examples.
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 10:22 AM
05-18-2009 10:22 AM
Re: "su -" from non-root to non-root same user without pw ?
You can use rlogin or remsh (with .rhosts) or ssh.
Otherwise there is no reason to use su from yourself to yourself.
>Doug: su from ora${sid} to ${sid}adm and back again
Once you su, you are not yourself. In your case, you could always exit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 10:25 AM
05-18-2009 10:25 AM
Re: "su -" from non-root to non-root same user without pw ?
login me
su - me
hence, my continued confusion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 10:29 AM
05-18-2009 10:29 AM
Re: "su -" from non-root to non-root same user without pw ?
login:me
su - me
which I can't see any use in, hence my continued confusion.
while Doug's example is between to different non-root users (which I had thought about)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 08:18 PM
05-18-2009 08:18 PM
Re: "su -" from non-root to non-root same user without pw ?
for all who needs a explanation of the backround of my question:
we use a custom applikation startup script on system start. in this script we use multiple su's to a specific application user with his application environment and start a process in backround with nohup. now we have the need that this unprivileged application user needs too this script to start and stop his processes.
schematic example:
su - appuser "nohup /path/programm1" &
su - appuser "nohup /path/programm2" &
su - appuser "nohup /path/programm3" &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 08:35 PM
05-18-2009 08:35 PM
Re: "su -" from non-root to non-root same user without pw ?
With in the script you can provide username and passwd for login into some specific user but its a security violation.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2009 10:53 PM
05-18-2009 10:53 PM
Solution>su - appuser "nohup /path/programm1" &
I suppose you could test if already appuser then do:
if [ "$(id -un)" != appuser ]; then
su - appuser "nohup /path/programm1" &
...
else
nohup /path/programm1 &
...
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2009 04:16 AM
05-19-2009 04:16 AM
Re: "su -" from non-root to non-root same user without pw ?
I didn't quite catch that the user was trying to su to his own account. My bad.
To the OP, the answer to your question is sudo. Provide sudo privileges to the appropriate users for the init script then the users so configured can run the script as root. Root can su to any account without a password.
The command syntax for the appuser would be:
sudo /sbin/init.d/app_init_script [start | stop ]
Run visudo and add the appropriate lines - something like the following should do the trick:
User_Alias APPUSER = ${user1}, ${user2}
Cmnd_Alias APPINIT = /sbin/init.d/app_init_script
APPUSER ALL=(ALL) APPINIT
*That's* how you get around that little issue.
Hope that helps.
Doug O'Leary
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2009 06:33 AM
05-19-2009 06:33 AM
Re: "su -" from non-root to non-root same user without pw ?
if you're "appuser" then run the commands w/o su, if you're not, then su as always
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2009 06:47 AM
05-19-2009 06:47 AM
Re: "su -" from non-root to non-root same user without pw ?
and sudo will indeed work, as you can run that script as root and it won't care about the su's