Difference between revisions of "VNC Linux Login"

From Hack Sphere Labs Wiki
Jump to: navigation, search
(Created page with "A script that starts a vncserver as a user allowing for a headless remote desktop. {{file|init.vncserver|content= #!/bin/sh -e ### BEGIN INIT INFO # Provides: vncser...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
A script that starts a vncserver as a user allowing for a headless remote desktop.
 
A script that starts a vncserver as a user allowing for a headless remote desktop.
  
{{file|init.vncserver|content=
+
{{file|init.vncserver|<nowiki>
 
#!/bin/sh -e
 
#!/bin/sh -e
 
### BEGIN INIT INFO
 
### BEGIN INIT INFO
Line 56: Line 56:
  
 
exit 0
 
exit 0
 +
</nowiki>
 +
}}
 +
 +
{{file|~.vnc/xstartup|<nowiki>
 +
 +
#!/bin/sh
  
 +
xrdb $HOME/.Xresources
 +
xsetroot -solid grey
 +
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 +
#x-window-manager &
 +
# Fix to make GNOME work
 +
export XKL_XMODMAP_DISABLE=1
 +
autocutsel -fork
 +
/etc/X11/Xsession
 +
 +
</nowiki>
 
}}
 
}}
 +
 +
 +
*vncpasswd allows you to set the password used to access VNC desktops. Its default behavior is to prompt for a VNC password and then store an obfuscated version of this password to passwd-file (or to $HOME/.vnc/passwd if no password file is specified.)
 +
 +
*openbox

Latest revision as of 08:30, 16 June 2015

A script that starts a vncserver as a user allowing for a headless remote desktop.

init.vncserver
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          vncserver
# Required-Start:    $network
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start a VNCServer
# Description Enable VNC remote access VIA vncserver
### END INIT INFO

PATH="$PATH:/usr/X11R6/bin/"

# The Username:Group that will run VNC
export USER="webdawg"
#${RUNAS}

# The display that VNC will use
DISPLAY="1"

# Color depth (between 8 and 32)
DEPTH="16"

# The Desktop geometry to use.
#GEOMETRY="<WIDTH>x<HEIGHT>"
#GEOMETRY="800x600"
GEOMETRY="1024x768"
#GEOMETRY="1280x1024"

# The name that the VNC Desktop will have.
NAME="leechme"

OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

. /lib/lsb/init-functions

case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;

stop)
log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;

restart)
$0 stop
$0 start
;;
esac

exit 0

~.vnc/xstartup

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
autocutsel -fork 
/etc/X11/Xsession



  • vncpasswd allows you to set the password used to access VNC desktops. Its default behavior is to prompt for a VNC password and then store an obfuscated version of this password to passwd-file (or to $HOME/.vnc/passwd if no password file is specified.)
  • openbox