HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- store a password for a script
Operating System - HP-UX
1837467
Members
4215
Online
110117
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
Go to solution
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
09-13-2000 05:53 AM
09-13-2000 05:53 AM
Can anyone suggest a way of storing a password, so it can be used in a script, without breaking 'all security rules'.
The best I can come up with is to create a user with a name which is almost imposible to remember, with an equally hard to memorise password. And store each in a different files with access rights, so they are hard to find/read. Not very secure in my opinion... (the script will give it all away)
Any better suggestions?
The best I can come up with is to create a user with a name which is almost imposible to remember, with an equally hard to memorise password. And store each in a different files with access rights, so they are hard to find/read. Not very secure in my opinion... (the script will give it all away)
Any better suggestions?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2000 05:58 AM
09-13-2000 05:58 AM
Re: store a password for a script
You could try using the crypt command on these passwords when they are stored in a file, and also use crypt to decrypt them when needed. This way at least they are a bit more secure when stored in a file.
Im from Palmerston North, New Zealand, but somehow ended up in London...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2000 06:07 AM
09-13-2000 06:07 AM
Solution
One technique is to keep the password in a file that is only readable by a particular user (that nobody can log in as) and to use the setuid bit (set-owner-ID-on file-execution - see man chmod) on the script that reads it.
This script would have to be responsible for its own security and would only return the password to one of a set of users or whatever restriction you wanted to employ.
You can also use the 'crypt' command to encrypt the password and use the setuid technique to obtain the encryption key.
I use a combination of both the above techniques for securely obtaining Oracle passwords for use by backup scripts etc.
On the subject of Oracle, never supply the password as a command line argument to any Oracle command as it can be seen in a 'ps' listing. For example instead of:-
sqlplus system/ <
do
sqlplus << EOD
system/
This script would have to be responsible for its own security and would only return the password to one of a set of users or whatever restriction you wanted to employ.
You can also use the 'crypt' command to encrypt the password and use the setuid technique to obtain the encryption key.
I use a combination of both the above techniques for securely obtaining Oracle passwords for use by backup scripts etc.
On the subject of Oracle, never supply the password as a command line argument to any Oracle command as it can be seen in a 'ps' listing. For example instead of:-
sqlplus system/
do
sqlplus << EOD
system/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2000 06:08 AM
09-13-2000 06:08 AM
Re: store a password for a script
Geetam:
It depends on what your script is trying to do. For example, let's say that you want a script that will automate logging onto another machine to execute some commands, you might want to consider using ssh with private/public key combinations with ssh.
The SSH documentation describes how you can setup two hosts to talk without exchanging passwords (only exchanging keys - which are unique to the machine-user combination)
security by obsurity is not very advisable!
Alternatively, you could write a program in c, and compile it with the password somehow embeded... maybe if you give more of an idea of what your program does, you might get more.
It depends on what your script is trying to do. For example, let's say that you want a script that will automate logging onto another machine to execute some commands, you might want to consider using ssh with private/public key combinations with ssh.
The SSH documentation describes how you can setup two hosts to talk without exchanging passwords (only exchanging keys - which are unique to the machine-user combination)
security by obsurity is not very advisable!
Alternatively, you could write a program in c, and compile it with the password somehow embeded... maybe if you give more of an idea of what your program does, you might get more.
nothing wrong with me that a few lines of code cannot fix!
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