本文共 918 字,大约阅读时间需要 3 分钟。
vi /etc/init.d/vnc#!/bin/bashPATH="$PATH:/usr/bin/"export USER="root"DISPLAY="1"DEPTH="24"GEOMETRY="1024x768"OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost". /lib/lsb/init-functionscase "$1" in start) log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/tightvncserver ${OPTIONS}" ;; stop) log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/tightvncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/vnc (start|stop|restart)" exit 1 ;;esacexit 0:wq!chmod +x /etc/init.d/vncupdate-rc.d vnc defaults
关闭vncserver
$ vncserver -kill :1 # 数字 1 为桌面号,对应客户端的端口为5901,以此类推2,3,4....
转载地址:http://wbfob.baihongyu.com/