telnet server problems

I posted this problem on qnxrtp.os but never got a response:


I’m having problems setting up a telnet server on an embedded system.

I’ve got TCP/IP setup to the point that I can ping the system and also ftp
to it but no telnet.

I run inetd, with the corresponding line in my inetd.conf file of:
telnet stream tcp nowait root /sbin/telnetd telnetd -Q

I’ve tried both the tiny TCP/IP stack and the full stack, neither worked.

The symptom is that when I try to telnet in I am prompted for a username and
a password (I have set up a user on my stack as well) and after they are
entered I get the following error:
loginConnection closed by foreign host.

Below is my bootimage buildfile and the corresponding init script.

Any help is greatly appreciated… I’ve been dealing with not being able
to telnet into my stack for WAY to long.

-Dan


bootimage buildfile :

[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot:/bin:/lib/dll LD_LIBRARY_PATH=/proc/boot:/lib:/dll
procnto
}

[+script] .script = {
pci-bios &
waitfor /dev/pci
devc-con -e &
reopen /dev/con1

for flashdisk

devb-eide blk cache=2m &
waitfor /dev/hd0t77 100
mount /dev/hd0t77 /

shell

[+session] esh -i /init.tcp_qnet &
}

load standard c library

libc.so

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so

Add for HD support

[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

add symbolic links for bin, dll, and lib

(files in /usr/nto with devb-eide)

[type=link] /bin=/usr/nto/x86/bin
[type=link] /dll=/usr/nto/x86/dll
[type=link] /lib=/usr/nto/x86/lib

Include the hard disk shared objects so we can access the disk

libcam.so
io-blk.so

Include the socket library

libsocket.so

For the QNX 4 filesystem

cam-disk.so
fs-qnx4.so

for qnet

npm-qnet.so

for the PCI bus

pci-bios

for floppy and flash drives

devb-eide

[data=copy]
devc-con
esh
mount

/etc/hosts = {
127.0.0.1 localhost.localdomain localhost
137.78.238.113 gse-lab.jpl.nasa.gov gse-lab
137.78.238.114 cryobot.jpl.nasa.gov cryobot
128.149.110.62 gse-office.jpl.nasa.gov gse-office
}

/etc/services = {
ftp 21/tcp
telnet 23/tcp
}

/etc/inetd.conf = {
ftp stream tcp nowait root /sbin/ftpd ftpd
telnet stream tcp nowait root /sbin/telnetd telnetd -Q
}




and here’s my init script:

echo ‘loading init.tcp_qnet_remote’

load network driver

/sbin/io-net &

load ethernet driver

mount -T io-net /lib/dll/devn-speedo.so

#load tcp/ip driver
mount -T
io-net -oif=en0:137.78.238.114:255.255.255.0,route=137.78.238.114:255.255.25
5.0:137.78.238.1, default=137.78.238.1
/lib/dll/npm-ttcpip.so

#load qnet driver
mount -T
io-net -ohost=cryobot.jpl.nasa.gov,resolve=dns,mount=:.jpl.nasa.gov
/lib/dll/npm-qnet.so

load programs for telnet and ftp servers

/sbin/inetd &
/sbin/pipe &
/sbin/devc-pty &

My guess would be: The telnetd runs login and login try to start
ksh and maybe the shell is not found. Do you know if all
config file are there /etc/passwd, /etc/shadow, /etc/profile/
and so. I do not know at this point which files are important
but at least these files should at there.


Bye Sascha( sascha@bitctrl.de )

Sascha Morgenstern
BitCtrl Systems GmbH
Weißenfelser Straße 67
Germany - 04229 Leipzig
Phon. +49 341 490 670
FAX. +49 341 490 67 15
eMail: sascha@bitctrl.de
WWW: http://www.bitctrl.de


“Dan Helmick” <danielhelmick@earthlink.net> schrieb im Newsbeitrag
news:9dq5je$pr8$1@inn.qnx.com

I posted this problem on qnxrtp.os but never got a response:


I’m having problems setting up a telnet server on an embedded system.

I’ve got TCP/IP setup to the point that I can ping the system and also ftp
to it but no telnet.

I run inetd, with the corresponding line in my inetd.conf file of:
telnet stream tcp nowait root /sbin/telnetd telnetd -Q

I’ve tried both the tiny TCP/IP stack and the full stack, neither worked.

The symptom is that when I try to telnet in I am prompted for a username
and
a password (I have set up a user on my stack as well) and after they are
entered I get the following error:
loginConnection closed by foreign host.

Below is my bootimage buildfile and the corresponding init script.

Any help is greatly appreciated… I’ve been dealing with not being able
to telnet into my stack for WAY to long.

-Dan


bootimage buildfile :

[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot:/bin:/lib/dll LD_LIBRARY_PATH=/proc/boot:/lib:/dll
procnto
}

[+script] .script = {
pci-bios &
waitfor /dev/pci
devc-con -e &
reopen /dev/con1

for flashdisk

devb-eide blk cache=2m &
waitfor /dev/hd0t77 100
mount /dev/hd0t77 /

shell

[+session] esh -i /init.tcp_qnet &
}

load standard c library

libc.so

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so

Add for HD support

[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

add symbolic links for bin, dll, and lib

(files in /usr/nto with devb-eide)

[type=link] /bin=/usr/nto/x86/bin
[type=link] /dll=/usr/nto/x86/dll
[type=link] /lib=/usr/nto/x86/lib

Include the hard disk shared objects so we can access the disk

libcam.so
io-blk.so

Include the socket library

libsocket.so

For the QNX 4 filesystem

cam-disk.so
fs-qnx4.so

for qnet

npm-qnet.so

for the PCI bus

pci-bios

for floppy and flash drives

devb-eide

[data=copy]
devc-con
esh
mount

/etc/hosts = {
127.0.0.1 localhost.localdomain localhost
137.78.238.113 gse-lab.jpl.nasa.gov gse-lab
137.78.238.114 cryobot.jpl.nasa.gov cryobot
128.149.110.62 gse-office.jpl.nasa.gov gse-office
}

/etc/services = {
ftp 21/tcp
telnet 23/tcp
}

/etc/inetd.conf = {
ftp stream tcp nowait root /sbin/ftpd ftpd
telnet stream tcp nowait root /sbin/telnetd telnetd -Q
}




and here’s my init script:

echo ‘loading init.tcp_qnet_remote’

load network driver

/sbin/io-net &

load ethernet driver

mount -T io-net /lib/dll/devn-speedo.so

#load tcp/ip driver
mount -T

io-net -oif=en0:137.78.238.114:255.255.255.0,route=137.78.238.114:255.255.25
5.0:137.78.238.1, default=137.78.238.1
/lib/dll/npm-ttcpip.so

#load qnet driver
mount -T
io-net -ohost=cryobot.jpl.nasa.gov,resolve=dns,mount=:.jpl.nasa.gov
/lib/dll/npm-qnet.so

load programs for telnet and ftp servers

/sbin/inetd &
/sbin/pipe &
/sbin/devc-pty &

You need devc-pty

“Dan Helmick” <danielhelmick@earthlink.net> wrote in message
news:9dq5je$pr8$1@inn.qnx.com

I posted this problem on qnxrtp.os but never got a response:


I’m having problems setting up a telnet server on an embedded system.

I’ve got TCP/IP setup to the point that I can ping the system and also ftp
to it but no telnet.

I run inetd, with the corresponding line in my inetd.conf file of:
telnet stream tcp nowait root /sbin/telnetd telnetd -Q

I’ve tried both the tiny TCP/IP stack and the full stack, neither worked.

The symptom is that when I try to telnet in I am prompted for a username
and
a password (I have set up a user on my stack as well) and after they are
entered I get the following error:
loginConnection closed by foreign host.

Below is my bootimage buildfile and the corresponding init script.

Any help is greatly appreciated… I’ve been dealing with not being able
to telnet into my stack for WAY to long.

-Dan


bootimage buildfile :

[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot:/bin:/lib/dll LD_LIBRARY_PATH=/proc/boot:/lib:/dll
procnto
}

[+script] .script = {
pci-bios &
waitfor /dev/pci
devc-con -e &
reopen /dev/con1

for flashdisk

devb-eide blk cache=2m &
waitfor /dev/hd0t77 100
mount /dev/hd0t77 /

shell

[+session] esh -i /init.tcp_qnet &
}

load standard c library

libc.so

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so

Add for HD support

[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

add symbolic links for bin, dll, and lib

(files in /usr/nto with devb-eide)

[type=link] /bin=/usr/nto/x86/bin
[type=link] /dll=/usr/nto/x86/dll
[type=link] /lib=/usr/nto/x86/lib

Include the hard disk shared objects so we can access the disk

libcam.so
io-blk.so

Include the socket library

libsocket.so

For the QNX 4 filesystem

cam-disk.so
fs-qnx4.so

for qnet

npm-qnet.so

for the PCI bus

pci-bios

for floppy and flash drives

devb-eide

[data=copy]
devc-con
esh
mount

/etc/hosts = {
127.0.0.1 localhost.localdomain localhost
137.78.238.113 gse-lab.jpl.nasa.gov gse-lab
137.78.238.114 cryobot.jpl.nasa.gov cryobot
128.149.110.62 gse-office.jpl.nasa.gov gse-office
}

/etc/services = {
ftp 21/tcp
telnet 23/tcp
}

/etc/inetd.conf = {
ftp stream tcp nowait root /sbin/ftpd ftpd
telnet stream tcp nowait root /sbin/telnetd telnetd -Q
}




and here’s my init script:

echo ‘loading init.tcp_qnet_remote’

load network driver

/sbin/io-net &

load ethernet driver

mount -T io-net /lib/dll/devn-speedo.so

#load tcp/ip driver
mount -T

io-net -oif=en0:137.78.238.114:255.255.255.0,route=137.78.238.114:255.255.25
5.0:137.78.238.1, default=137.78.238.1
/lib/dll/npm-ttcpip.so

#load qnet driver
mount -T
io-net -ohost=cryobot.jpl.nasa.gov,resolve=dns,mount=:.jpl.nasa.gov
/lib/dll/npm-qnet.so

load programs for telnet and ftp servers

/sbin/inetd &
/sbin/pipe &
/sbin/devc-pty &

That was it!!! Thanks much Sascha!

I already had all of the necessary config files in /etc but I was missing
/bin/sh, which login was attempting to call.

The only time I could see this error however, was when I manually ran
‘login’ locally.

So I simply put an alias from /bin/sh to /bin/ksh and all was well.

-Dan


“Sascha Morgenstern” <sascha@bitctrl.de> wrote in message
news:9dqfa6$1vr$1@inn.qnx.com

My guess would be: The telnetd runs login and login try to start
ksh and maybe the shell is not found. Do you know if all
config file are there /etc/passwd, /etc/shadow, /etc/profile/
and so. I do not know at this point which files are important
but at least these files should at there.


Bye Sascha( > sascha@bitctrl.de > )

Sascha Morgenstern
BitCtrl Systems GmbH
Weißenfelser Straße 67
Germany - 04229 Leipzig
Phon. +49 341 490 670
FAX. +49 341 490 67 15
eMail: > sascha@bitctrl.de
WWW: > http://www.bitctrl.de


“Dan Helmick” <> danielhelmick@earthlink.net> > schrieb im Newsbeitrag
news:9dq5je$pr8$> 1@inn.qnx.com> …
I posted this problem on qnxrtp.os but never got a response:


I’m having problems setting up a telnet server on an embedded system.

I’ve got TCP/IP setup to the point that I can ping the system and also
ftp
to it but no telnet.

I run inetd, with the corresponding line in my inetd.conf file of:
telnet stream tcp nowait root /sbin/telnetd telnetd -Q

I’ve tried both the tiny TCP/IP stack and the full stack, neither
worked.

The symptom is that when I try to telnet in I am prompted for a username
and
a password (I have set up a user on my stack as well) and after they are
entered I get the following error:
loginConnection closed by foreign host.

Below is my bootimage buildfile and the corresponding init script.

Any help is greatly appreciated… I’ve been dealing with not being
able
to telnet into my stack for WAY to long.

-Dan


bootimage buildfile :

[virtual=x86,bios +compress] .bootstrap = {
startup-bios
PATH=/proc/boot:/bin:/lib/dll LD_LIBRARY_PATH=/proc/boot:/lib:/dll
procnto
}

[+script] .script = {
pci-bios &
waitfor /dev/pci
devc-con -e &
reopen /dev/con1

for flashdisk

devb-eide blk cache=2m &
waitfor /dev/hd0t77 100
mount /dev/hd0t77 /

shell

[+session] esh -i /init.tcp_qnet &
}

load standard c library

libc.so

[type=link] /usr/lib/ldqnx.so.1=/proc/boot/libc.so

Add for HD support

[type=link] /usr/lib/libcam.so.1=/proc/boot/libcam.so.1

add symbolic links for bin, dll, and lib

(files in /usr/nto with devb-eide)

[type=link] /bin=/usr/nto/x86/bin
[type=link] /dll=/usr/nto/x86/dll
[type=link] /lib=/usr/nto/x86/lib

Include the hard disk shared objects so we can access the disk

libcam.so
io-blk.so

Include the socket library

libsocket.so

For the QNX 4 filesystem

cam-disk.so
fs-qnx4.so

for qnet

npm-qnet.so

for the PCI bus

pci-bios

for floppy and flash drives

devb-eide

[data=copy]
devc-con
esh
mount

/etc/hosts = {
127.0.0.1 localhost.localdomain localhost
137.78.238.113 gse-lab.jpl.nasa.gov gse-lab
137.78.238.114 cryobot.jpl.nasa.gov cryobot
128.149.110.62 gse-office.jpl.nasa.gov gse-office
}

/etc/services = {
ftp 21/tcp
telnet 23/tcp
}

/etc/inetd.conf = {
ftp stream tcp nowait root /sbin/ftpd ftpd
telnet stream tcp nowait root /sbin/telnetd telnetd -Q
}




and here’s my init script:

echo ‘loading init.tcp_qnet_remote’

load network driver

/sbin/io-net &

load ethernet driver

mount -T io-net /lib/dll/devn-speedo.so

#load tcp/ip driver
mount -T


io-net -oif=en0:137.78.238.114:255.255.255.0,route=137.78.238.114:255.255.25
5.0:137.78.238.1, default=137.78.238.1
/lib/dll/npm-ttcpip.so

#load qnet driver
mount -T
io-net -ohost=cryobot.jpl.nasa.gov,resolve=dns,mount=:.jpl.nasa.gov
/lib/dll/npm-qnet.so

load programs for telnet and ftp servers

/sbin/inetd &
/sbin/pipe &
/sbin/devc-pty &

\