Reputation: 2635
I used the script to log into the power broker and connected ssh through the network. As per my knowledge every single more is tracked. I am ok with that.
My question is how to hide the password, below sample I tried:
#!/usr/bin/expect -f
set timeout 2
spawn pbrun /bin/su - big_admin
expect {
"Password for casper@BIG_BANK.COM:" {send "foobar_pass!\r" ; exp_continue }
"*$*" ;
}
interact
I tried storing my password in a /home/casper/.password
and then doing a chmod 400 on it and then
putting it in the {send "/home/casper/.password\r" exp continue}
, but it did not work.
Any ideas?
Upvotes: 0
Views: 2581
Reputation: 16428
Source : http://wiki.tcl.tk/3594
Procedure to encrypt device passwords
proc utility_encrypt {pd filename} {
global key HOME
#catch [exec echo "$pd" | des -e -k $key -b > $HOME/pwdir/$filename]
catch [exec des -e -k $key -b > [file join $HOME pwdir $filename] << $pd]
return
}
Procedure to decrypt device passwords
proc utility_decrypt filename {
global key HOME
catch {exec cat $HOME/pwdir/$filename | des -d -b -k $key} dpd
# Some people write the previous command as
# catch {exec des -d -b -k $key < $HOME/pwdir/$filename} dpd
return $dpd
}
Upvotes: 1