-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.sh
23 lines (16 loc) · 1 KB
/
entry.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
mkdir -p /root/.vnc/
echo $VNCPWD | vncpasswd -f > /root/.vnc/passwd
chmod 600 /root/.vnc/passwd
vncserver :0 -rfbport $VNCPORT -geometry $VNCDISPLAY -depth $VNCDEPTH -localhost > /var/log/vncserver.log 2>&1
if [ ! -f /etc/ssl/certs/novnc_cert.pem -o ! -f /etc/ssl/private/novnc_key.pem ]
then
openssl req -new -x509 -days 365 -nodes -subj "/C=US/ST=IL/L=Springfield/O=OpenSource/CN=localhost" -out /etc/ssl/certs/novnc_cert.pem -keyout /etc/ssl/private/novnc_key.pem > /dev/null 2>&1
fi
cat /etc/ssl/certs/novnc_cert.pem /etc/ssl/private/novnc_key.pem > /etc/ssl/private/novnc_combined.pem
chmod 600 /etc/ssl/private/novnc_combined.pem
/usr/share/novnc/utils/launch.sh --listen $NOVNCPORT --vnc localhost:$VNCPORT --cert /etc/ssl/private/novnc_combined.pem --ssl-only > /var/log/novnc.log 2>&1 &
echo "Launch your web browser and open https://localhost:9020/vnc.html"
echo "Verify the certificate fingerprint:"
openssl x509 -in /etc/ssl/certs/novnc_cert.pem -noout -fingerprint -sha256
tail -f /dev/null