Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'iTerm - A Terminal app with tabbed windows' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
iTerm - A Terminal app with tabbed windows
Authored by: dlrodriguez on Apr 21, '03 10:25:23PM

Thanks for the info, but I already know this...and I am running
ssh-agent. Perhaps I didn't make myself clear.

Using ssh-keygen and ssh-agent, I have been able to set up the
Terminal app to log me into remote machines without entering
passwords. In fact, I have saved terminal sessions that show up
in my library directory that when selected open up new windows
and automatically log into the remote machine. This is very
convenient because I can customize each remote machine
differently. However, when I try this with the iTerm address
book, the new session that I open always asks me for the RSA
passphrase even though I have started up ssh-agent. If I simply
type ssh <remote-host> from an iTerm, it works fine..it logs in
without asking for a password. But this is not what I want. I
want to be able to hit the new button, scroll down to the already
set up address entry for the remote host, and have iTerm log
me in with no password in separate tab. This is what I have
failed to do (without having the session ask for my password
every time).

My questions are:
1) Has anyone also run into this problem?
2) Has anyone successfully used ssh-keygen and ssh-agent to
avoid entering passwords every time they log into a remote
machine with iTerm..in a new tabbed session window, that is?

thank you.

---
David



[ Reply to This | # ]
iTerm - A Terminal app with tabbed windows
Authored by: AndyF on Apr 22, '03 01:03:24PM

I have set up, in my ~/.MacOSX/environment.plist file, which is available to OSX programs (including iTerm)

<key>SSH_AUTH_SOCK</key>
<string>/Users/andy/.ssh/agent</string>

I have a shell script that I run to set up ssh-agent that looks like

#!/bin/sh
ps xc | grep -q ssh-agent && exit
new=/Users/andy/.ssh/agent
ssh-agent -s > ~/.ssh/env.save 2>/dev/null
. ~/.ssh/env.save
rm -f $new
ln -s $SSH_AUTH_SOCK $new
ssh-add

The script starts ssh agent, and make a symbolic link from the variable-named ssh-agent socket to the fixed name used in my environment.plist file.

Actually, I have more than that. I have also set

<key>SSH_ASKPASS</key>
<string>/Users/andy/Applications/SSHPassKey.app/Contents/MacOS/SSHPassKey</string>

so that SSHPassKey asks for the password. I believe this also requires having set

<key>DISPLAY</key>
<string>localhost</string>

(Perhaps those two variables are better set in the shell script...)

Finally, I made a simple apple script of the form 'do shell script "/Users/andy/bin/start.sh"' that is saved as a an application and run as a login item. Thus ssh is set up (once) when I first log in.



[ Reply to This | # ]
iTerm - A Terminal app with tabbed windows
Authored by: geekwagon on Apr 22, '03 06:56:33PM
The other reply you got should work, but if you don't want to reinvent the wheel with a bunch of scripts, try out Keychain.

I run it in my bash_profile so the script runs everytime I start a new shell. If it doesn't find a ssh-agent running, it will start one and ask for your passphrase. If one is running, it will silently set the proper environment variables to point your current shell to use the existing ssh-agent.

I just tried it with iterm and it works. I am using bash, so if you are using tcsh your mileage may vary.

Here's the URL: http://www.gentoo.org/proj/en/ keychain.xml

I tried to put in as a link but for some reason a %0d kept getting inserted into the URL. Anyone know what is up with that?

[ Reply to This | # ]