Friday, October 14, 2005

solaris 9 ssh ahangs on exit ?

solaris 9 ssh ahangs on exit ?

On solaris 9, recommended patches as of Dec 5th applied.

On occasion, exiting from an ssh session to another machine hangs. Is there
a fix for that ? We're using solaris' ssh.

Thanks

> On occasion, exiting from an ssh session to another machine hangs. Is there
> a fix for that ?

It usually happens when you start a background process and it doesn't
properly close its stdin/out/err. Adding >/dev/null and 2>&1 to command
line usually helps. Keyword here is "usually" -- if you run a program
that does something funny, like piping its stdout to child's stdin
with dup(), all bets are off.

The real problem is in SSH protocol and that can't be fixed in
implementation. So the real fix is to not use ssh.

Dima
--

>The real problem is in SSH protocol and that can't be fixed in
>implementation. So the real fix is to not use ssh.

So what *do* you use, if, say, you want to go from your
cable modem connection and log into the "shell account"
you have on an isp? Everyone says that telnet way, way too
dangerous, too easy to hack into.

Thanks

> So what *do* you use, if, say, you want to go from your

You use ssh. DM was being pedantic in saying that because the
protocol is broken then the only "fix" is not to use it -- unless you
fancy improving the protocol. On the other hand, I'm guessing that
ssh handles all of your needs bar the occasional hung session. Join
the club.

Read the section on Escape Characters in the manual and when your
session hangs on exit apply:

[RETURN] ~ &

or

[RETURN] ~ .

as appropriate. Noting, of course, that if you've ssh'd through
several boxes you may need to increase the number of escape chars.

Cheers,

Ian

> the club.

Yep. Interactive sessions are not a problem as there's a human
there to press enter-tilde-dot if it doesn't close. It's when
you run it from e.g. cron is when you should worry.

Dima
--
Things seemed simpler before we kept computers. -- IX, Revelation

0 Comments:

Post a Comment

<< Home