FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 06-19-2012, 07:55 PM
rikona
 
Default ssh problem

Saturday, June 16, 2012, 3:56:30 AM, Matt wrote:

> ----- Original Message -----

>> From: rikona <rikona@sonic.net>
>> To: ubuntu-users@lists.ubuntu.com
>> Cc:
>> Sent: Saturday, 16 June 2012, 1:49
>> Subject: ssh problem
>>
>> ssh stops working. I initiate the ssh contact in terminal; connects
>> reliably. I can ^C to stop it OK. I sometimes get a "broken pipe"
>> message, but can reconnect easily from the CLI.
>>
>> The problem is sometimes [more often than not] ssh just quits working
>> - no message in terminal, and ^C will NOT do anything. Terminal is not
>> responding to keyboard input. If I close the terminal window it warns
>> me that something is still running and it will stop if I close
>> terminal. I usually just close the window and start ssh again in a new
>> terminal window.
>>
>> What might be happening to ssh? What is the best way to diagnose this?
>> Best of all, is there a way to keep this from happening? It has become
>> a PITA. Before the last few updates, I do not recall this happening. I
>> run 10.04, updated.

> I think there were two identical IPs on the network but I'm not
> certain as I was in a hurry!

I checked all the IPs - don't seem to have a dup.

> I had this last week. Same symptoms. I changed the IP of the machine
> I was working from and it fixed it for good.

I tried it anyway :-) but it didn't seem to help...

> Hope that helps.

It was a good idea and worth a try - thanks!

--

rikona


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-19-2012, 07:55 PM
rikona
 
Default ssh problem

Saturday, June 16, 2012, 4:12:45 AM, Amichai wrote:

> I'd check the Syslog for clues. If nothing's there -

I didn't see anything that looked relevant - but - there's a lot of
strange-looking-to-me stuff there that I may have misinterpreted. :-)

> I used to have the same problem when connecting over a Firewall too.
> I now use the PUTTY SSH client and set the Keep Alive to -9. That
> did the trick for me...

I'll try that. I note the version for Lucid is a bit old and had a few
bugs, but still may be OK. Worth a try...

Thanks,

--

rikona


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-19-2012, 07:56 PM
rikona
 
Default ssh problem

Saturday, June 16, 2012, 9:32:01 AM, Avi wrote:

> Amichai Rotman wrote:

>> I'd check the Syslog for clues. If nothing's there -

> sshd logs to authlog;

I don't seem to have authlog - does that get produced with something I
don't have?

> it might be worth setting the log level to 'debug' or running the
> client with -vv,

What's vv? I don't seem to find what that is...

> but this does sound like a simple timout problem - an intermediate
> switch or router somewhere spots an absence of activity and closes
> the connection.

I get a 'broken pipe' msg that I was interpreting as a disconnect.
Terminal still works, though, and I can recover on the CLI.

Sometimes it just stops working, with no error msg, as does terminal.
If I close terminal it warns me something [presumably ssh] is still
running and will be stopped if I exit. I exit and start over, and a
new ssh connects to the remote comp OK. Is that also what happens with
a disconnect, or is something else going on?

Thanks,

--

rikona


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-19-2012, 09:08 PM
Chris Green
 
Default ssh problem

On Tue, Jun 19, 2012 at 12:54:29PM -0700, rikona wrote:
> Saturday, June 16, 2012, 3:46:14 AM, Chris wrote:
>
> >> What might be happening to ssh? What is the best way to diagnose
> >> this? Best of all, is there a way to keep this from happening? It
> >> has become a PITA. Before the last few updates, I do not recall
> >> this happening. I run 10.04, updated.
> >>
> > It sounds a bit like there's some sort of timeout in the connection.
> > I used to suffer from this when I used ssh to connect through the
> > firewall at work (with permission!). The firewall would drop the
> > connection after several minutes of inactivity. Setting any/all of
> > the keepalive settings in ssh didn't help, I finally resorted to a
> > background script started from .profile which sent a NUL character
> > every few minutes.
>
> I'd be interested in that script...
>
On looking I find it's actually an almost trivial C program, as follows:-

/*

Program to echo NULs periodically
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main(int argc, char * argv[])
{
int delay; // time between outputting NULs
int fd;
char nul[] = { 0 };

switch (argc)
{
case 1:
delay = 600; // default delay of 10 minutes
break;

default:
delay = atoi(argv[1]);
break;
}

while(1)
{
fd = open("/dev/tty", O_RDWR | O_NOCTTY);
if (fd < 0)
{
fd = open("/tmp/kaexit", O_RDWR);
write(fd, "ka exited
", 10);
exit(1);
}
write(fd, nul, 1);
close(fd);
sleep(delay);
}
}

Then in .profile (or .bash_profile) I have:-

#
#
# Run ka (keep alive) if this is a remote ssh login
#
if [ "$SSH_CLIENT" ]
then ka&
fi


> > The symptoms of the firewall dropping the connection were exactly as
> > you describe, connection stops working but no error message or other
> > symptoms, just silence.
>
> Did terminal stop responding to any input?
>
Yes.

--
Chris Green

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-20-2012, 09:50 AM
Avi Greenbury
 
Default ssh problem

rikona wrote:

> >> I'd check the Syslog for clues. If nothing's there -
>
> > sshd logs to authlog;
>
> I don't seem to have authlog - does that get produced with something I
> don't have?

It's at /var/log/auth.log; you should have it on a standard Ubuntu
install.

> > it might be worth setting the log level to 'debug' or running the
> > client with -vv,
>
> What's vv? I don't seem to find what that is...

It makes ssh print potentially useful debug messages. -v is less
verbose than -vv, I think there's a -vvv too.

> I get a 'broken pipe' msg that I was interpreting as a disconnect.
> Terminal still works, though, and I can recover on the CLI.
>
> Sometimes it just stops working, with no error msg, as does terminal.
> If I close terminal it warns me something [presumably ssh] is still
> running and will be stopped if I exit. I exit and start over, and a
> new ssh connects to the remote comp OK. Is that also what happens with
> a disconnect, or is something else going on?

No, that still sounds like it's just a simple timeout somewhere along
the way. If you establish an ssh connection to something and then pull
out the cable or disable WiFi you'll get similar symptoms.

--
Avi

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-20-2012, 06:37 PM
rikona
 
Default ssh problem

Tuesday, June 19, 2012, 2:08:05 PM, Chris wrote:

>> I'd be interested in that script...
>>
> On looking I find it's actually an almost trivial C program, as follows:-

I'm not a C programmer, so for me there isn't any "almost trivial C
program". :-)

I assume that program is 'ka'...

I'm doing port forwarding with ssh. Do I have to be port-specific in
the above pgm to keep the connection alive?

And, thanks much for the script.

> Then in .profile (or .bash_profile) I have:-

> #
> #
> # Run ka (keep alive) if this is a remote ssh login
> #
> if [ "$SSH_CLIENT" ]
> then ka&
> fi


>> > The symptoms of the firewall dropping the connection were exactly as
>> > you describe, connection stops working but no error message or other
>> > symptoms, just silence.
>>
>> Did terminal stop responding to any input?
>>
> Yes.

Good to know - thanks. I still don't understand why a disconnect
produces two quite different effects. Might it have to do with exactly
how the disconnect happened?

--

rikona


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 06-20-2012, 06:46 PM
rikona
 
Default ssh problem

Wednesday, June 20, 2012, 2:50:02 AM, Avi wrote:

> rikona wrote:

>> >> I'd check the Syslog for clues. If nothing's there -
>>
>> > sshd logs to authlog;
>>
>> I don't seem to have authlog - does that get produced with something I
>> don't have?

> It's at /var/log/auth.log; you should have it on a standard Ubuntu
> install.

I was looking for 'authlog', instead of 'auth.log' - locate DOES find
that. :-) I didn't see anything in auth.log that seemed relevant - a
TON of cron stuff, but little else...

>> > it might be worth setting the log level to 'debug' or running the
>> > client with -vv,
>>
>> What's vv? I don't seem to find what that is...

> It makes ssh print potentially useful debug messages. -v is less
> verbose than -vv, I think there's a -vvv too.

OK - again I misunderstood. I thought vv was perhaps a separate
error-finding shell under which ssh would run, not just an ssh option.
I am now running ssh with the -vv option. vv produces quite a lot of
output. :-) One can use vvv too, but I'm not sure I want to wade
through even more stuff. :-)

SSH seems to do a lot of stuff with channels 1 through 10 - the vast
majority of the log is ssh 'wading through' the many things that are
done on each of these channels. What are these channels, anyway?

Hopefully, that option will give a good clue as to what is going on
when it quits. Thanks for the tip.

>> I get a 'broken pipe' msg that I was interpreting as a disconnect.
>> Terminal still works, though, and I can recover on the CLI.
>>
>> Sometimes it just stops working, with no error msg, as does
>> terminal. If I close terminal it warns me something [presumably
>> ssh] is still running and will be stopped if I exit. I exit and
>> start over, and a new ssh connects to the remote comp OK. Is that
>> also what happens with a disconnect, or is something else going on?

> No, that still sounds like it's just a simple timeout somewhere
> along the way. If you establish an ssh connection to something and
> then pull out the cable or disable WiFi you'll get similar symptoms.

It would seem as though there are different kinds of disconnects -
some produce an error msg and some just hang terminal - two rather
different effects.

Thanks for the help...

--

rikona


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:15 PM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org