[CentOS] Source keychain credentials in Perl?

Sean Carolan

scarolan at gmail.com
Wed Mar 5 15:20:27 UTC 2008


Keychain is quite a useful tool for automating SSH logins without
having to use password-less keys:
http://www.gentoo.org/proj/en/keychain/

Normally it is used like this to set the SSH_AUTH_SOC and
SSH_AGENT_PID variables:
source ~/.keychain/hostname-sh

(This is what's in hostname-sh)
SSH_AUTH_SOCK=/tmp/ssh-XXn47DUn/agent.16721; export SSH_AUTH_SOCK;
SSH_AGENT_PID=16722; export SSH_AGENT_PID;

I would like these environment variables to be made available to a
Perl script so that any "system" commands contained in the perl script
will inherit them.  How do you do this in Perl?



More information about the CentOS mailing list