This isn't a question but more of a here's what I did as a possible way of using a password within a script.
In my case, my croned backups that run and encrypt tarball backup that I'll use a password to decrypt.
While it is possible to to place a password within the script, it's not a good idea for obvious reason.
What I have done in the past (and probably the recommended way) was to create a directory in /etc and chmod the directory so that only root can access the file within that contains the password for gpg to use.
I wanted to get away from that so my solution was to rewrite the script to a C program. Perhaps a bit out of the ordinary and of course, I save the source file off system. This is turning out to be the best working scenario for me.
This idea won't be for everyone but more of a possible way of using scripts that contain passwords on the system.
I would be curious on other ways folks are getting around the use of password within scripts.
In my case, my croned backups that run and encrypt tarball backup that I'll use a password to decrypt.
While it is possible to to place a password within the script, it's not a good idea for obvious reason.
What I have done in the past (and probably the recommended way) was to create a directory in /etc and chmod the directory so that only root can access the file within that contains the password for gpg to use.
I wanted to get away from that so my solution was to rewrite the script to a C program. Perhaps a bit out of the ordinary and of course, I save the source file off system. This is turning out to be the best working scenario for me.
This idea won't be for everyone but more of a possible way of using scripts that contain passwords on the system.
I would be curious on other ways folks are getting around the use of password within scripts.
Statistics: Posted by cds60601 — 2024-03-16 14:59 — Replies 0 — Views 2