ssh keychain for git pull cron
2013-08
I am a bit of a newbie with linux, so must apologize straight away if this is something obvious and/or silly.
I am trying to create a git pull cronjob that gets update from GitHub repo every few minutes.
Now the problem is that I can not get it working without entering pass-phrase every time cron runs.
ssh-agent and ssh-add does not do the trick as they loose the passwords every time user logs out. So I got the guide http://www.cyberciti.biz/faq/ssh-passwordless-login-with-keychain-for-scripts/
and followed it, but still no results.
I can not seem to get the keychain working properly. I think.
The steps I have done:
- Installed the keychain from RPMforge.
Edited the
vi $HOME/.bash_profile
to include:/usr/bin/keychain $HOME/.ssh/id_rsa
source $HOME/.keychain/$HOSTNAME-sh
And according to the guide, after I re-log, keychain should be working and I should not need to enter the pass-phrase every time I
ssh -T [email protected]
I am probably missing something, but can not seem to figure out what. Maybe someone has some suggestions ?
try this link to solved same problem link
its help full to you..
I have recently switched from Gnome to Xfce on Ubuntu 9.04.
In Gnome, the first time I entered the passphrase, it prompted me to save the passphrase.
In Xfce however, I am prompted for the passphrase every time I connect.
Is there a simple way to save the passphrase in Xfce?
Use ssh-agent
and ssh-add
?
If you've installed Seahorse (sudo apt-get install seahorse
), add export $(gnome-keyring-daemon --daemonize --start)
to your .bashrc
and you'll get the same SSH key behaviour as in vanilla Ubuntu.
I think this is what you're looking for:
If you have not already done so, set up your private and public key (See Githubs description about SSH key half way through Set Up Git). It is important that you add a passphrase to your private key.
Install the package ssh-askpass:
sudo apt-get install ssh-askpass
Add «/usr/bin/ssh-add» to your start up. Go to Settings – Settings manager – Session and startup. Go to Application Autostart and add an item that runs the command «/usr/bin/ssh-add«:
On next login you’ll get the following dialog asking for your passphrase. After entering it, you can open a terminal or use sftp in the file manager without typing a password.
ssh
application examines $SSH_ASKPASS
environment variable (man ssh
) and executes that application in order to get passphrase. You should switch this app to another one, that's capable of remembering: e.g. the one GNOME uses originally.