HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to su non-interactive in trusted mode
Operating System - HP-UX
1830931
Members
2387
Online
110017
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-05-2004 06:55 AM
08-05-2004 06:55 AM
how to su non-interactive in trusted mode
HPUX 11.11, converted to trusted mode, need to run some scripts that "su - username" and execute application startups. Now in trusted mode su wants a password, even though I am root.
How can I get around this?
How can I get around this?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2004 01:18 AM
08-06-2004 01:18 AM
Re: how to su non-interactive in trusted mode
Well, I tried duplicating your issue on 11.00 and 11.11 with no luck... su worked just like it does in untrusted mode. Of course, I was just using the default settings once I converted it to trusted.
--
Jeff Traigle
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2004 09:54 PM
08-06-2004 09:54 PM
Re: how to su non-interactive in trusted mode
You can do it with simple scripting or programming as,
mv your original /usr/bin/su to /usr/bin/suorg
Make your new script or program to ask passwd for su actions and call moved binary of /usr/bin/su for operation.
Make your binary or c program with the name as su and move it to /usr/bin/su so that it will be called when ever you use su.
And change the permission of binary or script so that others can not access it.
Sample script:
---------------
#!/usr/bin/ksh
# command options
hypen=$1
username=$2
passwd=$3
# Your plain-text passwd
passwd="passwdtest"
printf "passwd: "
read pwd
# /usr/bin/su1 is the real su command
if [[ $pwd = $passwd ]]; then
if [[ "$username" = "" ]]; then
/usr/bin/su $hypen
else
/usr/bin/su $hypen $username
fi
fi
It will be not be used to execute commands with su. Changes needed to make your requirement.
Regards
Muthu
mv your original /usr/bin/su to /usr/bin/suorg
Make your new script or program to ask passwd for su actions and call moved binary of /usr/bin/su for operation.
Make your binary or c program with the name as su and move it to /usr/bin/su so that it will be called when ever you use su.
And change the permission of binary or script so that others can not access it.
Sample script:
---------------
#!/usr/bin/ksh
# command options
hypen=$1
username=$2
passwd=$3
# Your plain-text passwd
passwd="passwdtest"
printf "passwd: "
read pwd
# /usr/bin/su1 is the real su command
if [[ $pwd = $passwd ]]; then
if [[ "$username" = "" ]]; then
/usr/bin/su $hypen
else
/usr/bin/su $hypen $username
fi
fi
It will be not be used to execute commands with su. Changes needed to make your requirement.
Regards
Muthu
Easy to suggest when don't know about the problem!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP