Dec 16, '03 10:14:00AM • Contributed by: guzzijason
So, I stumbled accross a shareware utility called Telnet Launcher. This utility works with Terminal.app and allows you to create lists, or groups of lists, of telnet and ssh connections. Not bad - it even includes an auto-login feature that saves your password for you. Unfortunately, when Panther was released, it apparently caused some major problems with Telnet Launcher. The latest version of Telnet Launcher (2.6.10) seems to have worked out the panther bugs, except the auto-login function is still broken. This is a minor bummer, but what I really wanted was RSA authentication anyway.
I could use RSA auth just fine from Terminal.app, but I found that Telnet Launcher bypassed the necessary environment variables that are set up by ssh-agent. I searched around online, but couldn't find any discussion about this. My problem was how to get shell environment variables to be used by applications launched in the MacOS GUI. Then I found it - you can set environment variables in the file ~/.MacOSX/environment.plist, and after you re-login to Mac OS X, all applications you launch will have these variables set. Excellent! There is even a utility out there called RCEnvironment that makes editing this file a snap.
So, in a nutshell, here are the steps needed to get Telnet Launcher to work with RSA authentication, asuming you already have your keys set up -- please note however, the following instructions are based on the assumption that you are already familiar0 with SSH and its RSA authentication scheme. Explaining how RSA authentication works, or how to set up the keys and such is outside the scope of this document, and I would recomment reading the man pages for ssh-keygen, ssh-agent, and ssh-add. Here's how to get it working...
- Start ssh-agent with the -a flag in order to manually define the name of the socket file (normally, this name is dynamically generated based on the pid of the process).
- Use ssh-add to add your key to the agent.
- Using RCEnvironment, create the environment variable SSH_AUTH_SOCK. The value for the variable should be the name of the socket file you defined with ssh-agent -a.
- Log out and then log back into Mac OS X. Any Terminal.app session started by Telnet Launcher should now make use of the new environment variable. If everything is set up right, your RSA (or DSA) authentication should be working fine!
This sure has made my life easier now that I have it working - I hope it can help out someone else too!