telnet woes (OpenSuSE 12.3)

Ever since i’ve upgraded to openSuSE 12.3 from 12.2 i’ve been having problems with telnet. I was able to (briefly) get the telnet daemon (in.telnetd) working, but upon logging in, the text was all corrupted and almost unreadable. I run a BBS (daydream BBS), and so I need telnet working. Before invoking the BBS itself, I get the
following error:

2013-03-17T10:40:31.061666-07:00 death login: FATAL: can't reopen tty: No such file or directory

And then;

2013-03-17T10:40:31.061694-07:00 death ddtelnetd[6921]: Closed connection

I’m not sure if these two issues are related or not. If anyone could shed some light on this, i’d be much appreciated.

Thanks,
-JBL

Hi, and welcome

What are the contents of /etc/xinetd.d/telnet
the results of systemctl status xinetd.service
and is your firewall open on TCP/IP port 23 ?

There should be no reason for telnet for a very long time. Why not ssh ?


rayH

On 2013-03-18 14:26, eng-int wrote:
> There should be no reason for -telnet- for a very long time. Why not
> -ssh- ?

There is. He has a BBS. If you don’t understand why, it is because you
are not familiar with BBSs :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Not since about 1989. I am surprised that the BBSs had not switched to ssh.

On Mon 18 Mar 2013 02:16:01 PM CDT, eng-int wrote:

robin_listas;2537274 Wrote:
>
> There is. He has a BBS. If you don’t understand why, it is because you
> are not familiar with BBSs :slight_smile:

Not since about 1989. I am surprised that the BBSs had not switched to
ssh.

Hi
AFAIK BBS clients should handle ssh (eg syncterm), so I would imagine
the BBS servers can do the same.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.3 (x86_64) Kernel 3.7.10-1.1-desktop
up 18:21, 5 users, load average: 0.01, 0.10, 0.42
CPU Intel® i5 CPU M520@2.40GHz | GPU Intel® Ironlake Mobile

On 2013-03-18 15:53, malcolmlewis wrote:

>> On Mon 18 Mar 2013 02:16:01 PM CDT, eng-int wrote:
>>
>>
>> robin_listas;2537274 Wrote:
>>>
>>> There is. He has a BBS. If you don’t understand why, it is because you
>>> are not familiar with BBSs :slight_smile:
>>
>> Not since about 1989. I am surprised that the BBSs had not switched to
>> ssh.

> Hi
> AFAIK BBS clients should handle ssh (eg syncterm), so I would imagine
> the BBS servers can do the same.

BBS software is old and little maintained. For example, I keep a copy
of golded compiled on 2001. It can not be recompiled because the source
uses constructs that the current GCC refuses to accept. I don’t know
where to obtain current sources if they exist, because the sites that
may have them are in Russian and I don’t read it.

The BBS node that I connected to till last December died. The admin was
running it on OS/2 and the power supply died. He failed getting a
replacement PU. Apparently he also has been unable to get another
machine running OS/2, and a friend of him is trying to get him to get
the node running under Linux. That may take months.

Most of the BBSs that survive use old software. They managed to change
from using telephone modems to use TCP/IP and telnets and similar
constructs. With the few developers that they have, it is about all they
can do, ssh support has not been applied.

And it is not only ssh… I use binkd, which also uses plain password
exchange.

Other people have to use telnet for other reasons. For example, my
router has ssh, but it is impossible to connect to it using ssh after I
forget which openSUSE release. Previously it worked. So if I want to
admin it, it is telnet. Dangerous? Yes, nominally. No, as there is
nobody in my network.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Well, i’ve made some progress. I am now able to login to the BBS. Problem now is, it only connects, maybe 1 time out of 20, with a “Connection closed by foreign host.” But, anyway…


death:~ # cat /etc/xinetd.d/telnet
service telnet
{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /home/dd/rundd
        flags           = REUSE NODELAY KEEPALIVE
        log_on_failure += USERID
}


death:~ # rcxinetd status

Checking for service xinetd:                                                                                     running
xinetd.service - LSB: Starts the xinet daemon. Be aware that xinetd doesn't start if no service is configured to run under it. To enable xinetd services go to YaST Network Services (xinetd) section.
          Loaded: loaded (/etc/init.d/xinetd)
          Active: active (running) since Mon, 2013-03-18 08:55:03 PDT; 24min ago
         Process: 19557 ExecStop=/etc/init.d/xinetd stop (code=exited, status=0/SUCCESS)
         Process: 19986 ExecReload=/etc/init.d/xinetd reload (code=exited, status=0/SUCCESS)
         Process: 19571 ExecStart=/etc/init.d/xinetd start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/xinetd.service
                  Ôöö 19579 /usr/sbin/xinetd -pidfile /var/run/xinetd.init.pid

Mar 18 09:10:08 death.org login[21941]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:10:16 death.org login[21953]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:10:18 death.org login[21958]: FATAL: can't reopen tty: Input/output error
Mar 18 09:10:18 death.org login[21963]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:10:19 death.org login[21968]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:10:19 death.org login[21978]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:10:20 death.org login[21989]: FATAL: can't reopen tty: Input/output error
Mar 18 09:10:21 death.org login[22004]: pam_unix(login:session): session opened for user dd by dd(uid=0)
Mar 18 09:11:20 death.org login[22062]: FATAL: can't reopen tty: No such file or directory
Mar 18 09:16:22 death.org login[22285]: FATAL: can't reopen tty: No such file or directory

Yes, firewall is open on port 23.

Thanks much,
JBL

this is what I have for a default openSuSE-12.3 telnet install and configuration:


sysman@valeria:~> cat /etc/xinetd.d/telnet
# default: off
# description: Telnet is the old login server which is INSECURE and should \
#       therefore not be used. Use secure shell (openssh).
#       If you need telnetd not to "keep-alives" (e.g. if it runs over a ISDN \
#       uplink), add "-n".  See 'man telnetd' for more details.
service telnet
{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        disable         = no
}


sysman@valeria:~> sudo systemctl status xinetd.service
xinetd.service - LSB: Starts the xinet daemon. Be aware that xinetd doesn't start if no service is configured to run under it. To enable xinetd services go to YaST Network Services (xinetd) section.
          Loaded: loaded (/etc/init.d/xinetd)
          Active: active (running) since Tue, 2013-03-19 03:16:34 GMT; 49s ago
         Process: 26993 ExecStop=/etc/init.d/xinetd stop (code=exited, status=0/SUCCESS)
         Process: 27017 ExecStart=/etc/init.d/xinetd start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/xinetd.service
                  └ 27025 /usr/sbin/xinetd -pidfile /var/run/xinetd.init.pid

Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/svnserve [file=/etc/x...ne=14]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/systat [file=/etc/xin...ne=15]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/telnet [file=/etc/xin...ne=17]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinet...ne=14]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/time-udp [file=/etc/x...ne=15]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Reading included configuration file: /etc/xinetd.d/vnc [file=/etc/xinetd...ne=15]
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Mar 19 03:16:33 valeria.eng-int.net xinetd[27025]: Started working: 4 available services
Mar 19 03:16:34 valeria.eng-int.net xinetd[27017]: Starting INET services. (xinetd)..done
Mar 19 03:16:34 valeria.eng-int.net systemd[1]: Started LSB: Starts the xinet daemon. Be aware that xinetd doesn't start if...tion..
sysman@valeria:~> 

So what is /home/dd/rundd ?

From the man pages for telnetd and xinetd.conf the flag KEEPALIVE seems redundant and REUSE is deprecated.

From How do I use TCP_NODELAY?

How do I use TCP_NODELAY?

First off, be sure you really want to use it in the first place. It will disable the Nagle algorithm (see ``2.11 How can I force a socket to send the data in its buffer?‘’), which will cause network traffic to increase, with smaller than needed packets wasting bandwidth. Also, from what I have been able to tell, the speed increase is very small, so you should probably do it without TCP_NODELAY first, and only turn it on if there is a problem.

So what is /home/dd/rundd ?

It is a script to launch the BBS.

What i’m concerned with, is:


Mar 19 09:29:37 death.org login[3306]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:37 death.org login[3311]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:38 death.org login[3316]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:38 death.org login[3321]: FATAL: can't reopen tty: Input/output error
Mar 19 09:29:38 death.org login[3326]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:39 death.org login[3331]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:39 death.org login[3336]: FATAL: can't reopen tty: Input/output error
Mar 19 09:29:40 death.org login[3341]: FATAL: can't reopen tty: No such file or directory
Mar 19 09:29:40 death.org login[3347]: pam_unix(login:session): session opened for user dd by dd(uid=0)
Mar 19 09:29:42 death.org login[3356]: FATAL: can't reopen tty: No such file or directory

Why can’t it reopen the tty?

TIA,
JBL

Ok, I figured something out: While trying to login to the BBS, it struck me, that perhaps udev (?) or whichever “service” weren’t allowing the creation of new /dev/pts/* ttys. Check this out:


2013-03-19T21:50:34.751130-07:00 death ddtelnetd[9501]: Closed connection
2013-03-19T21:55:52.753812-07:00 death login: FATAL: can't reopen tty: Input/output error

This is a “normal” (IE, “dropped”) connection to the BBS. It doesn’t “answer.”
Now, check this out:


2013-03-19T21:55:54.611916-07:00 death login: pam_unix(login:session): session opened for user dd by dd(uid=0)
2013-03-19T21:55:54.613786-07:00 death systemd-logind[571]: New session 214 of user dd.
2013-03-19T21:55:54.625835-07:00 death login: LOGIN ON pts/6 BY dd

Now this is what it looks like (what it’s supposed to look like) when the BBS actually “answers” the connection. Notice the creation of “pts/6”

So, now I need to figure out how to make the system “create” new “pts/*” when the BBS is invoked.

Anyone know anything about this?

TIA,
JBL

According to Wikipedia, original golded was forked long ago and fork named golded+ is available here: GoldED+.

You might be interested in this bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=904182

So what is /home/dd/rundd ?

It is a script to launch the BBS.

But we do not know what it does. Perhaps it would help for us to see it? If it is big using http://paste.opensuse.org/

I suspect that it attempt to start telnetd and then the BB. If it just gets the first bit wrong (non systemd/udev happy) then it should be trivial to split the two.

Can you try the* /etc/xinetd.d/telnet* that I posted? Just to see whether you have a functional telnet server when xinetd is started.

The two log extracts in your last post. I do not understand what you did to produce them.

It does appear that the user “dd” (presumably the owner of the BBS processes) has a UID of “0” (root). Is this a good idea, or is this just a temporary sudo while starting the telnet daemon?


death:~ # cat /home/dd/rundd

#!/bin/bash
ansi bbs
export TERM=ansi.sys
/home/dd/bin/ddtelnetd -udd

Can you try the* /etc/xinetd.d/telnet* that I posted? Just to see whether you have a functional telnet server when xinetd is started.

Yes, I tried it. And it does work. However, there is some text distortion. I used someone’s (forgot their name, sorry) solution to that problem, though. And it does work. However, with syncterm (a BBS telnet client), the text distortion is still present.

The two log extracts in your last post. I do not understand what you did to produce them.

I merely snipped those lines from syslog.
UNLESS… you mean, how did I acquire them? I just telnetted to my local machine, and tried logging in until it connected (a couple dozen times).

It does appear that the user “dd” (presumably the owner of the BBS processes) has a UID of “0” (root). Is this a good idea, or is this just a temporary sudo while starting the telnet daemon?

You know, I actually have no idea on that one. Although, it lists the root user in /etc/xinet.d/telnet, at the “user” line. So, root, maybe? shrug

Thanks,
JBL

On 2013-03-20 06:36, arvidjaar wrote:
>
> robin_listas;2537378 Wrote:
>> For example, I keep a copy
>> of golded compiled on 2001. It can not be recompiled because the source
>> uses constructs that the current GCC refuses to accept. I don’t know
>> where to obtain current sources if they exist, because the sites that
>> may have them are in Russian and I don’t read it.
>
> According to Wikipedia, original golded was forked long ago and fork
> named golded+ is available here: ‘GoldED+’
> (http://golded-plus.sourceforge.net/download.html).

That’s version “GoldED+/LNX 1.1.4.7”, the same one I have from 2001. It
does not build. In fact, clicking on those links give error 404.

Though I see on the files link above a version labeled
“gpl115-20120229.zip” which should be newer.

Interesting. These files were not there last time I looked. Thanks.

The source pack is dated 2007, though.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Re: in.telnetd that works fine on my 12.3. However when I telnet in (using the telnet client that comes with openSuSE) in and log in to my admin account (whose $HOME has migrated from probably SuSE-8.x) I get a somewhat distorted display, as if I was using the wrong terminfo. But if I telnet log in as a newly created user, test1, then the display is good enough for me to use the ncurses version of YaST.

The DailyDream BBS is not using openSuSE’s in.telnetd , but has its own ddtelnetd.

I merely snipped those lines from syslog.
UNLESS… you mean, how did I acquire them? I just telnetted to my local machine, and tried logging in until it connected (a couple dozen times).

I had forgotten that you could telnet in sometimes, and couldn’t work out how you got the “success” log entries.

I have downloaded daydream-2.14.9.tar.gz and had a quick look inside the tarball. Later I will make a virtual minimal 12.3, and try compiling and installing DD. I could not see from the documentation how to start/stop the BBS after it is installed. Hopefully it will be easy to either alter a script so that DD uses in.telnetd, or find out what is wrong with ddtelnetd in 12.3.


rayH

I have downloaded daydream-2.14.9.tar.gz and had a quick look inside the tarball. Later I will make a virtual minimal 12.3, and try compiling and installing DD. I could not see from the documentation how to start/stop the BBS after it is installed. Hopefully it will be easy to either alter a script so that DD uses in.telnetd, or find out what is wrong with ddtelnetd in 12.3.

Thank you much. I appreciate it. In the HOWTO that comes with Daydream, it uses the “xinetd.d/telnet” solution that I had originally tried using.
I must point out that, upon telnetting to my machine I get the following text before the “login” prompt:


death:~ # telnet localhost

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do NEW-ENVIRON
td: recv do SUPPRESS GO AHEAD
td: send will SUPPRESS GO AHEAD
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: recv will TSPEED
td: recv will LFLOW
td: send do LFLOW
td: recv will LINEMODE
td: send dont LINEMODE
td: recv will NEW-ENVIRON
td: recv do STATUS
td: send will STATUS
td: recv will XDISPLOC
td: send suboption TERMINAL-SPEED SEND
td: send suboption X-DISPLAY-LOCATION SEND
td: send suboption ENVIRON SEND 
td: send suboption TERMINAL-TYPE SEND
td: recv suboption NAWS 0 83 (83) 0 43 (43)
td: recv suboption TERMINAL-SPEED IS 38400,38400
td: recv suboption X-DISPLAY-LOCATION IS "death.org:0"
td: recv suboption ENVIRON IS VAR "DISPLAY" VALUE "death.org:0"
td: recv suboption TERMINAL-TYPE IS "XTERM"
td: send do ECHO
td: recv wont ECHO
td: send will ECHO

Thanks,
JBL

I have not had a chance to try installing Daydream yet, I am away from home and connecting to my test 12.3 machine via ssh.

I had not thought of a telnet session to localhost. It works fine on my laptop (openSuSE-11.4 evergreen). On the remote 12.3 machine telnet localhost results in dropped characters, including from the terminal control sequences. When I use telnet to login to the 12.3 machine remotely, all is well.


death:~ # telnet localhost

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
td: send do TERMINAL TYPE
td: send do TSPEED
td: send do XDISPLOC
td: send do NEW-ENVIRON
td: recv do SUPPRESS GO AHEAD
td: send will SUPPRESS GO AHEAD
td: recv will TERMINAL TYPE
td: recv will NAWS
td: send do NAWS
td: recv will TSPEED
td: recv will LFLOW
td: send do LFLOW
td: recv will LINEMODE
td: send dont LINEMODE
td: recv will NEW-ENVIRON
td: recv do STATUS
td: send will STATUS
td: recv will XDISPLOC
td: send suboption TERMINAL-SPEED SEND
td: send suboption X-DISPLAY-LOCATION SEND
td: send suboption ENVIRON SEND 
td: send suboption TERMINAL-TYPE SEND
td: recv suboption NAWS 0 83 (83) 0 43 (43)
td: recv suboption TERMINAL-SPEED IS 38400,38400
td: recv suboption X-DISPLAY-LOCATION IS "death.org:0"
td: recv suboption ENVIRON IS VAR "DISPLAY" VALUE "death.org:0"
td: recv suboption TERMINAL-TYPE IS "XTERM"
td: send do ECHO
td: recv wont ECHO
td: send will ECHO

I have since upgraded my kernel. This is no longer an issue.

-JBL