Discussion:
bgplgsh via telnet
(too old to reply)
Max Clark
2010-11-13 15:54:00 UTC
Permalink
Hello,

I am creating a public route server for our network. bgplgsh is the
ideal utility for what I need however I need to expose access to this
app via telnet. Newer versions of OpenBSD do not have a telnet daemon,
I've experimented with tcpserver from the ucspi package without
success. How do I give access to the bgplgsh application only via
telnet?

Thanks in advance,
Max
Andy Bradford
2010-11-13 18:25:41 UTC
Permalink
I've experimented with tcpserver from the ucspi package without
success. How do I give access to the bgplgsh application only via
telnet?
Probably because you are missing a tty. If you also install ptyget[1]
you might be able to accomplish it with something like:

tcpserver -v 0 1234 ptyrun /usr/bin/login -f -u bgplg bgplg

or maybe:

tcpserver -u `id -u bgplg` -g `id -g bgplg` -v 0 1234 ptyrun /usr/bin/bgplgsh

Andy

[1] http://cr.yp.to/software/ptyget-0.50.tar.gz
Ted Unangst
2010-11-13 19:51:07 UTC
Permalink
Post by Max Clark
I am creating a public route server for our network. bgplgsh is the
ideal utility for what I need however I need to expose access to this
app via telnet. Newer versions of OpenBSD do not have a telnet daemon,
I've experimented with tcpserver from the ucspi package without
success. How do I give access to the bgplgsh application only via
telnet?
download the telnetd source, compile, install.
Max Clark
2010-11-15 20:06:53 UTC
Permalink
Andy,

This is perfect thank you - I'm ended up using the following in the
daemontools supervise script:

#!/bin/sh
exec 2>&1
exec envuidgid rviews tcpserver -vDRHl0 0 23 ptyrun /usr/bin/bgplgsh

Two more questions for you:

- is it possible to set a timeout on the tcpserver/ptyrun/bgplgsh
program? I want the server to disconnect the remote user after 30
seconds of inactivity.

- tcpserver has a -B option to display a banner - this seems to need
to be inline with the tcpserver execution. Do you know of a way to
include an external file? Or even better is there a way to have
ptyrun/bgplgsh display the motd?

Thanks,
Max


On Sat, Nov 13, 2010 at 10:25 AM, Andy Bradford
Post by Andy Bradford
I've experimented with tcpserver from the ucspi package without
success. How do I give access to the bgplgsh application only via
telnet?
Probably because you are missing a tty. If you also install ptyget[1]
tcpserver -v 0 1234 ptyrun /usr/bin/login -f -u bgplg bgplg
tcpserver -u `id -u bgplg` -g `id -g bgplg` -v 0 1234 ptyrun
/usr/bin/bgplgsh
Post by Andy Bradford
Andy
[1] http://cr.yp.to/software/ptyget-0.50.tar.gz
Loading...