Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm working as a programmer at the moment, and as a result need to constantly upload my software to remote systems for testing. I have about 7 machines which need to receive copies of everything.

At the moment, I have a short bash script with a scp performing the transfer for each remote machine:

echo -e "\nUpdating Taiwan Machine"
scp {file1,file} bschlinker@taiwan:/home/bschlinker/
echo -e "\nUpdating Wisconsin Machine"
scp -P 2400 {file1,file2} bschlinker@wisconsin:/home/bschlinker/

I'm painfully prompted for the password to each machine. I recognize I can solve this with SSH keys -- but I don't want to have passwordless authentication to the remote machines via the key. As a result, I have a passphrase set on my SSH key. I read that after entering your passphrase once, it will remain active for the rest of the current terminal session. Is that true? If not, any ideas?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

If you have a SSH agent running (such as the cleverly-named ssh-agent) then you can add the key to the agent and the SSH client will communicate with the agent to get the key from it.

share|improve this answer
    
+1 for linking to an article about keychain - anyone who uses ssh should use keychain... –  James Jun 29 '10 at 23:02
2  
I don't use keychain. Never had a need for it. –  Ignacio Vazquez-Abrams Jun 29 '10 at 23:19

You need SSH-AGENT for this. Then, depending on your OS, you can configure it to start running when you log-in and prompt you for passphrase. Afterwards, as long as you are logged in, it will provide ssh sessions with your keys.

SSH-AGENT also does something more clever - if you ssh to one machine and from that machine ssh on to a third server on which you also have your public key, the second machine will also get automatically authenticated through the agent (its called agent forwarding).

share|improve this answer
    
Forwarding only happens with ssh -A IIRC. –  Andrew Jun 29 '10 at 23:08
    
Thats one possibility. The other is setting it in the config file. Some clients do this automatically (Putty, I think). –  chenshap Jun 30 '10 at 17:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.