Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#16285 - 31/08/2000 15:25 Telnet server installation (telnetd)
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
I've been having the hardest time getting a telnet server to work on empeg... I'm consistantly getting a message:
Telnetd: getpty: No such file or directory

Here's what I did..
AFTER setting everything up so that it works w/ ftp/ping/etc...
Made sure that inetd.conf to include the line:
telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.telnetd

...and that services contained:
telnet 23/tcp

...then downloaded telnetd_0.16-4.deb from the debian distribution; chrooted to my debian dest, ran dpkg-dev -x telnetd_0.16-4.deb telnetd; exited out of my deb destribution
cp the telnetd directory (which included
/usr/lib/telnetd/login
/usr/sbin/in.telnetd ) to the right places in empeg's environment..

What am I missing? Any clues what that message means? in.telnetd is actually being called when I try to connect, but it's missing something and dying.:(
-mark





...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#16286 - 01/09/2000 07:53 Re: Telnet server installation (telnetd) [Re: dionysus]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
Hmm.. Setting up a telnet server *can't* be uncharted teoritory.. I *know* others have gotten it to work; so how come no response to my plea-for-help?
-mark

...proud to have owned one of the first Mark I units
_________________________
http://mvgals.net - clublife, revisited.

Top
#16287 - 01/09/2000 12:17 Re: Telnet server installation (telnetd) [Re: dionysus]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Unfortunately, the real world has been intruding recently.

Over the weekend I will fix the http server and play with the telnet daemon.

However, a search found this http://www.mailgate.org/linux/linux.debian.chinese/msg00016.html,
this http://www.debian.org/Lists-Archives/debian-sparc-0006/msg00080.html,
this http://www.linuxsa.org.au/mailing-list/1999-07/483.html,
and this http://ftp://ftp.ca.debian.org/pub/linux/docs/lanana/device-list/devices.txt.

Have you tried mknod -m 666 /dev/ptmx c 5 2

It sounds like for debugging, we need to get http://www.debian.org/Packages/stable/utils/strace.html.



Top
#16288 - 01/09/2000 12:25 Re: Telnet server installation (telnetd) [Re: dionysus]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Actually, I think there should be a separate sub-section for installing files. I think what you wrote is the right way to do it because installing the package manager in empeg's environment would take up too much space. Installing it under the Debian root environment and then copying the files to empeg is better.


Top
#16289 - 02/09/2000 08:46 Re: Telnet server installation (telnetd) [Re: dionysus]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Hi there ...

Does someone know how to deDeb a Deb Package on a Windows machine?

thanks Mirko

.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16290 - 02/09/2000 08:55 Re: Telnet server installation (telnetd) [Re: Blacksun]
dionysus
veteran

Registered: 16/06/1999
Posts: 1222
Loc: San Francisco, CA
On a windows machine? no, but you can use the dpkg-dev to do it on empeg..
-mark

MK2: 36gb
Tivo 90gb
Computer: 120gb disk space
...I think drive manufactureres love me!
_________________________
http://mvgals.net - clublife, revisited.

Top
#16291 - 02/09/2000 09:29 Re: Telnet server installation (telnetd) [Re: dionysus]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Yes... I did this and have now a pc .zip file with the telnetd package.
Was only interested if there exist such a tool ...

thank's mirko

.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16292 - 02/09/2000 14:16 Debugging telnetd [Re: hamzy]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
I decided to learn how to use strace and here are my
experiences...

First, get strace from here. And install it in you Debian root environment and copy it to empeg's.

Make the following file:
empeg:/usr/sbin# cat /usr/sbin/in.telnetd.debug
#! /bin/sh
exec strace -o /tmp/telnetd.strace /usr/sbin/in.telnetd

and then

empeg:/usr/sbin# chmod +x in.telnetd.debug

This file is created in /tmp/telnetd.strace whenever someone telnets into empeg:

execve("/usr/sbin/in.telnetd", ["/usr/sbin/in.telnetd"], [/* 14 vars */]) = 0
brk(0) = 0x201bf14
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/v4l/libutil.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib/v4l", 0xbffff1bc) = -1 ENOENT (No such file or directory)
open("/lib/libutil.so.1", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=58553, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0H\v\0\000"..., 4096) = 4096
old_mmap(NULL, 38208, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4001f000
mprotect(0x40021000, 30016, PROT_NONE) = 0
old_mmap(0x40027000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0) = 0x40027000
close(4) = 0
open("/lib/libc.so.6", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=952068, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0008\202\1"..., 4096) = 4096
old_mmap(NULL, 934360, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40029000
mprotect(0x400ff000, 57816, PROT_NONE) = 0
old_mmap(0x40101000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xd0000) = 0x40101000
old_mmap(0x4010a000, 12760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4010a000
close(4) = 0
personality(PER_LINUX) = 8388608
getpid() = 173
brk(0) = 0x201bf14
brk(0x201c0b4) = 0x201c0b4
brk(0x201d000) = 0x201d000
getpeername(0, {sin_family=AF_INET, sin_port=htons(1344), sin_addr=inet_addr("192.168.1.100")}}, [16]) = 0
setsockopt(0, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
open("/dev/ptmx", O_RDWR) = -1 ENODEV (No such device)
open("/dev/ptyp0", O_RDWR) = -1 ENOENT (No such file or directory)
write(0, "telnetd: getpty: No such file or"..., 47) = 47
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, {1, 0}) = 0
_exit(1) = ?

Do the same for the Debian Root environment. Now you have two samples. One that
works and one that fails. Start diffing the two and find out whats wrong.

I don't know why it didnt load ptmx. Perhaps a module in the kernel is needed.
However, it seems like /dev/ptyp0 is missing. Creating ptyp0 with

mknod -m 666 /dev/ptyp0 c 2 0

Got me a little further. Now, I needed ttyp0 as well.

mknod -m 666 /dev/ttyp0 c 3 0

Then I noticed that I was missing a user called tty. I don't know if it was
necessary, but I was making the two files similar, so I added it. First, copy
the chgrp executable from the Debian Root environment and then add tty to
/etc/group

echo "tty:*:5:" >> /etc/group
chgrp tty /dev/*tty*

I also noticed that the file permissions were different in /dev. So I fixed
that. And then I made a directory that was missing.

chmod 666 /dev/*tt*
mkdir /var/run

Then I added some more missing files from the Debian root environment (On
my system, it lives in /drive0/tmp).

cp /drive0/tmp/etc/issue.net /etc
cp /drive0/tmp/etc/nsswitch.conf /etc
cp /drive0/tmp/etc/host.conf /etc

Sigh. It still didn't work. I don't know why I dediced to run login from
the command line, but that was missing in empeg's environment. That
finally allowed me to telnet in.

cp /drive0/tmp/bin/login /bin


P.S.: I also added this line in /etc/passwd, but I think that it might be automatically generated. Not sure, but here it is:

telnetd:!:101:101::/usr/lib/telnetd:/bin/false


and I added the corresponding group to /etc/group

telnetd:x:101:


Top
#16293 - 02/09/2000 16:42 Re: Debugging telnetd [Re: hamzy]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
I don't know if it was obvious from the post or not, but you need to tell inetd to run in.telnetd.debug instead of in.telnetd and restart inetd.

Then when you are done, switch back to in.telnetd


Top
#16294 - 03/09/2000 13:20 Re: Debugging telnetd [Re: hamzy]
Blacksun
new poster

Registered: 01/05/2000
Posts: 17
Hi all ...

My Telnetd is now all so up and running. Thanks to hamzy's instructions.
But I can only make one telnet session at a time. Do we need to open additional tty's ?

.. Mirko

.: i love my empeg!!
_________________________
.: i love my empeg!!

Top
#16295 - 03/09/2000 19:14 Re: Debugging telnetd [Re: Blacksun]
hamzy
journeyman

Registered: 11/08/2000
Posts: 51
Loc: TX, USA
Yes.

Please keep in mind that this is an embedded device and not your average PC.


Top