Jump to content
funtoo forums
  • 0
Sign in to follow this  
combre

Trying to automatize ssh-add inside Keychain

Question

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

#!/bin/bash
PASS="mypass"
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`

by

. /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

Max

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...