安装vnc:

apt-get update 
apt-get install xorg lxde-core tightvncserver -y

设置vnc密码:

tightvncserver :1

重启桌面:

tightvncserver -kill :1
echo "lxterminal & /usr/bin/lxsession -s LXDE &">>~/.vnc/xstartup
tightvncserver :1

安装Firefox(iceweasel)和 Flash:

apt-get update 
apt-get install iceweasel flashplugin-nonfree -y

设置重启脚本,将下列代码保存到/root,并命名为ebesucher.sh:

export DISPLAY=localhost:1.0
rm -rf ~/.vnc/*.log /tmp/plugtmp* > /dev/null
killall /usr/bin/x-www-browser >> /dev/null 2>&1
killall iceweasel >> /dev/null 2>&1
/usr/bin/iceweasel -new-tab http://www.ebesucher.com/surfbar/fylisheng > /dev/null 2>&1 &

添加权限:

chmod +x /root/ebesucher.sh

about:config 设置:

extensions.blocklist.enabled  false

下载扩展:

wget https://www.ebesucher.com/data/firefoxaddon/latest.xpi

资源管理器打开home目录,拖到浏览器安装扩展,打开扩展,设置id,三个选项选中 设置重启firefox打开空白页 禁用储存历史纪录(2016.4.13不记录似乎会报错,扩展设置了6小时删除,此处暂时不禁用) 内容/语言增加ip服务器所在地语言

设置开机启动桌面+vncserver 编辑/etc/init.d/tightvncserver:

#!/bin/sh
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $syslog $remote_fs $network
# Required-Stop: $syslog $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts VNC Server on system start.
# Description: Starts tight VNC Server. Script written by James Swineson.
### END INIT INFO
 
# /etc/init.d/tightvncserver
VNCUSER='root'
case "$1" in
 start)
 su $VNCUSER -c '/usr/bin/tightvncserver :1'
 echo "Starting TightVNC Server for $VNCUSER"
 ;;
 stop)
 pkill Xtightvnc
 echo "TightVNC Server stopped"
 ;;
 *)
 echo "Usage: /etc/init.d/tightvncserver {start|stop}"
 exit 1
 ;;
esac
exit 0

然后运行设为开机启动vncserver:

chmod 755 /etc/init.d/tightvncserver 
update-rc.d tightvncserver defaults

以下命令可以取消开机启动:

update-rc.d -f tightvncserver remove

建立以下脚本,放在rc.local 加载:

#!/bin/sh
CheckProcess()
{
if [ "$1" = "" ];
then
return 1
fi
PROCESS_NUM=`ps -ef|grep "$1"|grep -v "grep"|wc -l`
if [ $PROCESS_NUM -lt 1 ];
then
return 0
else
return 1
fi
}
while [ 1 ];do
CheckProcess "iceweasel";
Check_Result=$?
if [ $Check_Result -eq 0 ];
then
/root/ebesucher.sh
fi
sleep 10
done

设置crontab,三小时重启一次浏览器:

0 */3 * * *  /root/ebesucher.sh

运行时间太久,vnc会因为密码被扫描多次而禁用,用以下脚本重启:

tightvncserver -kill :1
tightvncserver :1