Difference between revisions of "Managing multiple SSH agents"
← Older edit
Newer edit →
Managing multiple SSH agents (view source)
Revision as of 06:59, 26 August 2016
1,756 BYTES ADDED
,  5 YEARS AGO
→‎OS X solution: A better OS X solution using launchd
 
== OS X solution ==
 
=== Using multiple agents via launchd (better) ===
This has been tested on Mac OS X El Capitan. It should work on older releases, please update this text if it works with later versions of OSX.
 
You can start multiple ssh-agents through launchd user LaunchAgents.
 
To make this work write the following plist to <code>~/Library/LaunchAgents/org.wmflabs.ssh-agent.plist</code>
 
<syntaxhighlight lang="xml"><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.wmflabs.ssh-agent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh-agent</string>
<string>-l</string>
</array>
<key>ServiceIPC</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockPathName</key>
<string>/private/tmp/.ssh-agent-labs</string>
</dict>
</dict>
<key>RunAtLoad</key><true/>
<key>EnableTransactions</key>
<true/>
</dict>
</plist>
</syntaxhighlight>
 
Then load the agent:
<code>launchctl load ~/Library/LaunchAgents/org.wmflabs.ssh-agent.plist</code>
and if you want, start it
<code>launchctl start org.wmflabs.ssh-agent</code>.
 
This will start an ssh agent instance every time you login that will be reachable at <code>/private/tmp/.ssh-agent-labs</code>.
 
Repeat the process for every domain you're connecting to.
 
You can then proceed as suggested in the Linux section below in order to configure ssh. Please note that openssh 7.3 is only available via homebrew at the time of writing. However, do NOT use homebrew's ssh-agent in the launch agent as it's not interacting well with launchd.
 
 
=== Run one agent per terminal ===
The default terminal application can be modified in how it runs to have every tab run its own ssh-agent.
 
Giuseppe Lavagetto
BUREAUCRATS, CONTENT ADMINISTRATORS, ADMINISTRATORS
686
EDITS
Wikitech
Privacy policy
Terms of Use
Desktop
HomeRandomLog in Settings DonateAbout WikitechDisclaimers