vnc.html 提供用戶自行設定功能,其中包含 View Only 選項,但這無法強制用戶進入 View Only 模式。
vnc_auto.html 檔成 vnc_viewonly.html 檔。
[root@dywftp ~]# cd /usr/share/novnc/ [root@dywftp novnc]# cp vnc_auto.html vnc_viewonly.html
vnc_viewonly.html,刪除 Ctrl+Alt+Del 重新開機按鈕,並設定 view_only 為 true。
[root@dywftp novnc]# diff -uNwB vnc_auto.html vnc_viewonly.html
--- vnc_auto.html 2014-08-27 13:16:29.494410252 +0800
+++ vnc_viewonly.html 2014-08-27 13:16:18.251209012 +0800
@@ -87,8 +87,8 @@
window.onload = function () {
var host, port, password, path, token;
- $D('sendCtrlAltDelButton').style.display = "inline";
- $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
+// $D('sendCtrlAltDelButton').style.display = "inline";
+// $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
// By default, use the host and port of server that served this file
@@ -118,7 +118,7 @@
'true_color': WebUtil.getQueryVar('true_color', true),
'local_cursor': WebUtil.getQueryVar('cursor', true),
'shared': WebUtil.getQueryVar('shared', true),
- 'view_only': WebUtil.getQueryVar('view_only', false),
+ 'view_only': WebUtil.getQueryVar('view_only', true),
'updateState': updateState,
'onPasswordRequired': passwordRequired});
rfb.connect(host, port, password, path);
http://vncserver:port/vnc_viewonly.html,輸入密碼後即可看到遠端桌面,但無法工作。