Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 0

Trying to automatize ssh-add inside Keychain



Hey there,


First i'd like to thank you for your awsome work, keep it up :D

I'm am currently trying to setup ssh-add automatization inside Keychain, so the user select his keyname and enter his passphrase then Keychain do its work. In order to do that my app feed to the user's data to the following script

install -m700 <(echo "echo $PASS") "/tmp/ps.sh"
[[ -z "$DISPLAY" ]] && export DISPLAY=:0
< ~/.ssh/id_rsaName SSH_ASKPASS="/tmp/ps.sh" ssh-add - >/dev/null 2>/dev/null && shred -n3 -uz  /tmp/ps.sh >/dev/null 2>/dev/null

Wich I source in Keychain (v7.1 line 1460) by replacing

sshout=`ssh-add ${ssh_timeout} ${ssh_confirm} "$@" 2>&1`


. /tmp/auto-ssh-add

Then I just added

eval `keychain --eval --agents ssh ~/.ssh/id_rsaName`

in .bash_profile. It works like a charm, except I was planning to delete the script where the passphrase is written.

Do you see how I can use the beauty of Keychain and feed ssh-add user's information automatically only once?


Thanks in advance


Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...