>Well, but then you failed to understand how ssh-agent and agent
>forwarding works, you don't need to enter the passphrase on each
>login, only once and ssh-agent will keep it in memory. That's the
>purpose of it.
Ah, I see what you meant. ssh-agent was designed for exactly what you
mentioned. In an Expect script, I do not exactly make use of that
feature (ssh-agent terminates as Expect exits). As mentioned before:
ssh-agent -Expect script -ssh-add (will prompt for passphrase)
-ssh -l usrname
automatically
-set Clearcase view or
something automatically
-run applications
automatically
-get into interactive mode
for user to use shell
The whole thing can be wrapped in a shell script (e.g. ssh.sh). Now
when ssh logs off due to inactivities. All you need to do is to run
ssh.sh and enter the passphrase again; the passphrase can be put into
the Expect script (unsecure of course!) for 100% automatic operation.
The normal manual usage is probably something like:
ssh-agent xterm -ssh-add (add passphrase)
-ssh -l usrname
-usr is now connected to the remote host
-run apps and do work
If ssh logs off, run ssh -l again (no
passphrase required)
I think Expect can definitely make life a lot easier WITHUT
jeapodizing the security ssh provides. If you compare the two methods
above, perhaps the Expect way is more secure?