[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why does my ssh session terminate immediately?



On 2013-04-24 23:38:06 +0200, Andreas Leha wrote:
> Vincent Lefevre <vincent@vinc17.net> writes:
> > On 2013-04-24 05:03:53 +0200, Andreas Leha wrote:
> >> Vincent Lefevre <vincent@vinc17.net> writes:
> >> >> BTW, does "ssh -t localhost" work on both machines?
> >> 
> >> I am not sure.  On the 'client' it does.  On the 'server' I get this:
> >> ,----
> >> | > ssh root@192.168.2.109 bash
> >> | ssh -t localhost
> >> | Pseudo-terminal will not be allocated because stdin is not a terminal.
> >> | Host key verification failed.
> >> `----
> >
> > That's normal if you don't have a tty in the first place.
> > Don't you have some kind of console?
> 
> I am not sure I understand that question.

Is there some kind of terminal access without needing ssh or telnet?

> > $ ssh -t root@192.168.2.109 ls -l /dev/pts
> 
> Here, I get
> ,----
> | total 0
> | crw--w---- 1 root tty  136, 0 Apr 24 21:19 0
> | c--------- 1 root root   5, 2 Jan  1  1970 ptmx
> | Connection to 192.168.2.109 closed.
> `----

One can see that pts/0 has been created and used.

> > You can also try whether telnet over SSH works... Or just simple
> > telnet if the local network is secure. If this works, you can try
> > again "ssh -t localhost" (or just "ssh localhost", since -t is
> > implied without a command) from there.
> 
> I get the same problem using telnet:
> ,----
> | > telnet 192.168.2.109
> | Trying 192.168.2.109...
> | Connected to 192.168.2.109.
> | Escape character is '^]'.
> | Debian GNU/Linux 6.0
> | debian login: andreas
> | Password: 
> | Last login: Wed Apr 24 21:35:35 UTC 2013 from 192.168.2.101 on pts/0
                                                                ^^^^^^^^
> | Linux debian 2.6.32-5-kirkwood #1 Sun May 6 16:57:51 UTC 2012 armv5tel
> | 
> | The programs included with the Debian GNU/Linux system are free software;
> | the exact distribution terms for each program are described in the
> | individual files in /usr/share/doc/*/copyright.
> | 
> | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
> | permitted by applicable law.
> | Connection closed by foreign host.
> `----

So, it seems that pts/0 has correctly been allocated.

But in both cases (ssh and telnet), there's a problem. Since it
happens also with telnet, I doubt there's any problem with sshd.
Perhaps a bug related to the (pseudo-)ttys.

Look at /var/log/messages on the remote machine to see if there is
any error message. Just in case...

You can also search Google for "Connection closed by foreign host".
According to

  http://www.geexbox.org/forum/topic/telnet-connection-closed-by-foreign-host/

there was a recent bug affecting Raspberry Pi (ARM). Your machine is
also ARM-based. It might be related...

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: