Web Hosting Talk







View Full Version : passwording a tar.gz file


Al Nadeem
09-11-2002, 07:39 AM
hi
im doing a remote backup with one of my friends server, he backup his files on my server and i backup my files on his server..

i was wondering if i can passwrd protect a tar.gz file, i usuly do a :
tar -czf /tmp/backup.tar.gz /home/backup

i want to know if there is a way to put a password on the file backup.tar.gz so no one can open or extract the file.

dose tar support (passwords) ?

apollo
09-11-2002, 11:31 AM
I think it doesn't support passwords.... but there should be a tool that does password protect file.... never needed it on unix thought..

chrisb
09-12-2002, 02:33 AM
There are more secure ways, but this works fairly well. Just

1) put the following in an .htaccess file in the same dir as filename.tar.gz

<Files filename.tar.gz>
AuthType Basic
AuthName "RESTRICTED"
AuthGroupFile /dev/null
AuthUserFile DIRECTORY_PATH/.htpasswd
require valid-user
</Files>

2. Create a file named .htpasswd and add as many usernames as you like. Be sure and encrypt the passwords. They should look like the below with username:password

EXAMPLES:
username:en7cr$yp.lo
bobc:iw372.s8ew;o