VNC-Wrapper

Randolf-Heiko Skerka rh-skerka "at" itsec-debis.de
Wed, 29 Sep 1999 12:46:34 +0000


Hi guys!

Well I=B4ve written a really short wrapper (9 lines shell script) that wo=
rks
as an VNC Wrapper. It=B4s a quick and dirty hack, written in 10 minutes.

Well, here it is:

1st: Add this line to /etc/services:
vnc             5900/tcp        # VNC-Wrapper

2nd: Add this line to /etc/inetd.conf:
vnc stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/vncwrapper

3rd: The wrapper script

--- snip ---
#!/bin/sh
# VNC-Wrapper by Randolf Skerka, randolf "at" skerka.de
BASE=3D/tmp/VNCWRAP
NC=3D/usr/local/bin/nc

GET=3D`cat ${BASE}/used ${BASE}/available | sort -n | uniq -u | head -1`
echo $GET >> ${BASE}/used
${NC} localhost ${GET}
grep -v ${GET} ${BASE}/used > ${BASE}/used.new
mv ${BASE}/used.new ${BASE}/used
--- snap ---

All you need is to add all vncserver ports of the system to
${BASE}/available, one each line. Then connect with vncviewer to system:0.

  Randolf Skerka

--=20
+------------------------------------------------------------------------=
+
| Randolf Skerka                              debis IT Security Services =
|
| Tel. +49-228-9841-510                       Rabinstrasse 8, 53111 Bonn =
|
|         2 weeks free trial: Security news every day www.dcert.de       =
|
+------------------------------------------------------------------------=
+

---------------------------------------------------------------------
The VNC mailing list - see http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------