[Solved] How do you set a password environment?

Need help with C, C++, perl, python, etc?

[Solved] How do you set a password environment?

Postby bester69 » 2020-05-22 08:26

Hi,
How do you set a password environment param?, do you have to unset it just after using so not giving enought time for anyone to track it?

I would do it like this.,,tell me please, If Im doing wrong or can be done in some better way.. :roll: , thanks.
(secrets.sh script picks a password from a secrets file)

Code: Select all
export RCLONE_CONFIG_PASS=$(sudo /home/user/scripts/secrets.sh XXYY6)
rclone  sync source/ target/ &
sleep 1 && unset RCLONE_CONFIG_PASS
while  ! -z $(pgrep -f /bin/rclone); do; sleep 1 && echo "wait for rclone task" ; done;


Whith that code we only give one second to exposing the password... How do you usually do this?
Last edited by bester69 on 2020-05-22 10:54, edited 1 time in total.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1801
Joined: 2015-04-02 13:15

Re: How do you set a password environment?

Postby bester69 » 2020-05-22 08:49

ok, perhaps this!!, doesnt seem to be an easy way but this:
https://unix.stackexchange.com/questions/212329/hiding-password-in-shell-scripts
There's a way to store passwords in a bash script but you have to encrypt and obfuscate the script so that no one can actually read it or run any type of debugger on it to see exactly what it is doing.


I wonder what linux apps do we have to make it easy and create to binary:roll:

:arrow: >> shc
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1801
Joined: 2015-04-02 13:15


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable