in reply to Re: SSH to multiple servers
in thread SSH to multiple servers

But how do you automate once you've set a passphrase? Aren't you back to putting a password/passphrase in a file?

Replies are listed 'Best First'.
Re^3: SSH to multiple servers
by dsheroh (Monsignor) on Jun 26, 2006 at 16:30 UTC
    You can use ssh-agent and ssh-add to allow you to manually enter the passphrase once, then have the keys available to all shells/programs you run under the agent, including your ssh-to-multiple-servers app. (Most Linux distros run ssh-agent by default when you log in under X, at least; if it's not active, ssh-agent bash will open a new shell with an active agent.)

    So the worst-case process would be:

    1. Log in
    2. Run ssh-agent bash
    3. Run ssh-add, which prompts for your passphrase
    4. Enter passphrase
    5. Run the multiple-ssh program
    Step 2 may not be necessary if you're running under an ssh-agent by default. If you completely trust the system you're running on, steps 3 and 4 can be skipped by using an empty passphrase on the private key, but I wouldn't recommend doing so unless you need it to be able to run unattended (e.g., from cron), since that does go back to putting the complete login credentials into a file.