This is an introduction to the ssh-remote-agent program. This program will allow you to authenticate using a private key stored on a remote Linux machine to access other Linux machines, analogous to using ssh with ssh-agent (Manual Page for ssh-agent) (Example Use of ssh-agent).
The ssh-remote-agent client and server programs are installed on the pkirack machines in the /usr/local/bin directory. For testing purposes, pkirack2 is designated as the 'home' machine, pkirack1 is the 'secure key-server' machine, and pkirack3 & 4 are the 'remote' machines.
ssh-remote-agent -s pkirack1
Other command options are: -l to list the key, -k to kill the server, -d to delete the keypair, -h to print the command usage, or -n to generate a new key pair.
If a key pair doesn't exist on the secure machine, a new key pair is automatically generated. The RSA keys are stored in the .ssh/ssh-remote-agent subdirectory key-server machine.
This command also starts the client on the home machine, which authenticates using the private key connection to the secure machine. Commands to set up the environment variable SSH_AUTH_SOCK are printed. The ssh, ssh-copy-id, and ssh-add programs use this variable to locate the authorization service. To export the SSH_AUTH_SOCK variable to your shell, cut and paste the:
line into your terminal window. This socket directory and file name are only examples and will be different for each instance of ssh-remote-agent.export SSH_AUTH_SOCK=/tmp/ssh-tMV0vC0SZC/agent.18308
Alternatively, use this command to automatically export the SSH_AUTH_SOCK variable to your terminal shell:
eval `ssh-remote-agent -s pkirack1`
ssh-copy-id pkirack4
This adds the public key to the .ssh/authorized_keys file.
ssh pkirack4 'w; last|head; uname -a'
ssh-add -l
ssh-add -L
While the programs are fairly robust, sometimes they get bolluxed up. In this case it's best to leave the processes running and IM joe_muggli@yahoo or email me.
ssh-remote-agent -k
The processes will time-out after ten minutes.