1820658 Members
2412 Online
109626 Solutions
New Discussion юеВ

file passwords

 
SOLVED
Go to solution
simon_164
Super Advisor

file passwords

can we put a password on a tar file or a cpio file?
or any regular file. I am having the idea of creating the file then set ACL on the file for a special user and when i want to access it i will su. but how about putting in the tape? would the ACL be removed/
what do you think about all that?
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: file passwords

Shalom simon,

yes.

Be careful with the permissions.

You should use vipw to access the actual password file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
paolo barila
Valued Contributor

Re: file passwords

Hi,

-yes the tar command removes ACL

-if a file belongs to root user and
has permission 400, every other user has to "su" to read it (you can tar and restore it).

You should consider installing "sudo" anyway.

Pablo
share share share
Geoff Wild
Honored Contributor

Re: file passwords

You could use pgp to encrypt/decrypt the file with a password.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Mustafa Gulercan
Respected Contributor

Re: file passwords

hi;
for HP-UX you should use gpg.
not pgp..

regards..
Cesare Salvioni
Trusted Contributor
Solution

Re: file passwords

hi
any kind of permission is useless if you give away the files. Only way is crypting in someway and give the password to the recipient.
The suggested way are the best but on hpux you don't have, in my knowledge, them by default.
Instead you can use the simple command crypt:

tar cvf tarfile.tar .
crypt < tarfile.tar > tarfile_crypted.tar

it ask a password and crypt the file
to decrypt
crypt < tarfile_crypted.tar > tarfile.tar
again it ask the password

This is also the crypting algorithm used by ed and vi to crypt/decrypt text files

hope it helps
simon_164
Super Advisor

Re: file passwords

thank You!!