why not just simplify it all, and have
1:
create a init.d script that can start a desktop with the proper su - username command...
2:
refer to that script in rc-update so it will start with boot (in case of reboots)
3:
screw ssh when it's on the local network, and rather use ssh from the outside (it's obvious that cbolin originally wants this to happen when on local network)
then, when remote, use ssh to port forward a connection through the ssh tunnel, and use vncviewer to open the desktop through that tunnel with localhost::portnumber as adress.
that would require that portnumber to coincide with the listening port on the server in question (although not opened in the firewall cuz that kinda defeats the purpose)
now.. the init.d script would look a little something like this:
Code: Select all
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
need net
}
start() {
ebegin "Starting VNC desktop 1"
/path/to/suexecutable - <your username> -c "nohup /path/to/vncserverexecutable -geometry 1280x1024 -depth 24"
}
stop() {
ebegin "Stopping VNC desktop client"
/path/to/vncserverexecutable -kill :1
}
that will start and stop a vncserver with init.d commands rather than whatever you're trying to pull..
using 'rc-update add -nameofvncinitdfile- default' will give you the same function at boot time
that is a persistent vncserver as well.. so no more hassle..
-blc

