- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Password for text file on HP-UX 11.11
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
10-27-2005 03:28 AM
10-27-2005 03:28 AM
Password for text file on HP-UX 11.11
How do I create a password for text file on HP-UX 11.11?
Thanks,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 03:35 AM
10-27-2005 03:35 AM
Re: Password for text file on HP-UX 11.11
You can also lauch vi with the -x option.
vi -x myfile
It will then prompt you for a key used to encrypt/decrypt myfile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 07:28 AM
10-27-2005 07:28 AM
Re: Password for text file on HP-UX 11.11
I have more questions as follows:
1. Can an entire directory be password protected? If yes, what commands that can be used to achieve this?
2. Can an existing text file be password protected?
Thanks,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 07:43 AM
10-27-2005 07:43 AM
Re: Password for text file on HP-UX 11.11
To update the file you must do the following:
Become root
cd to the /yourdir directory
Enter the command:
pgp pwd_list.pgp
Enter the pass phrase when prompted
A new plain text file named pwd_list will be created. Edit this file and make your changes. You can use your text editor of choice (vi, emacs)
After the changes have been made re-encrypt the file using the command:
pgp -cw pwd_list
When prompted, enter/reenter the pass phrase
Answer y for yes to overwrite the existing pwd_list.pgp file
Test that you can see your changes by using the command:
pgp -m pwd_list.pgp
Enter the pass phrase when prompted
After viewing the file enter the command:
blank_term
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2005 07:48 AM
10-27-2005 07:48 AM
Re: Password for text file on HP-UX 11.11
There is not protection of directory levels. As a matter of fact, the protection Clay described is not a password protection in the sense you presume. It is altering the contents of the file by encryption depending on the key value you provide. You will still be able to access the file even if it is encrypted but will make no sense out of the contents of the file. Whereas, in real password protection, the file will not be accesible to you at all.
The way to accomplish this is using ownership and group memberships of the people who can read/write/execute a file. If this is not granular enough for your purpose, there is a whole new can of worms called ACLs to help you accomplish your goal but, you have to be really, really know about them upto your eyeballs or you will lock even yourself out of your files and find yourself in a mess that clean up would nearly be impossible.
To protect an existing file, assuming named as file.txt:
crypt mypassword
now your file is encrypted and written into file.prot At this point it is your responsibility to delete the clear text version.
to recover the clear text file back:
crypt mypassword
or
open your file with vi as follows:
vi -x file.txt
when asked for key, enter the password you want to use
modify the file by at least a single character then go to command mode (by hitting escape) and type
:wq!
next time you want to access this file, use the same command and same password, otherwise you will see garbled character soup instead of your original text.
HTH
UNIX because I majored in cryptology...