Linux/Mint18/systemd: VNC on loginscreen

problem: need VNC Access to your Linux machine before user log in?

solution:

apt-get -y remove vino
apt-get -y install x11vnc
mkdir /etc/x11vnc
x11vnc --storepasswd /etc/x11vnc/vncpwd
# *******
# *******
# Y
nano /lib/systemd/system/x11vnc.service
[Unit]
Description=x11vnc VNC Server for X11
Requires=lightdm.service
After=lightdm.service

[Service]
Type=forking
ExecStart=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -display WAIT:0 -ncache 10 -forever -nevershared -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc/vncpwd -rfbport 5900 -xkb -norc -noxrecord -noxdamage -nomodtweak
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2

[Install]
WantedBy=graphical.target
systemctl daemon-reload
systemctl enable x11vnc.service
systemctl start x11vnc.service || reboot

done.
on OSX, for example, connect with RealVNC Viewer

Server Umzug – Traffic an neuen Server weiterleiten während DNS Updates sich verteilen

Den HTTP und HTTPS Traffic mit iptables an den neuen Server weiterleiten:


#!/bin/sh

# redirect traffic on specified ports to other IP

# own/old IP
ME="176.9.123.123"

# new/destination IP
NEW="144.76.123.123"

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -F
iptables -t nat -F
iptables -X

#port 80 forwarding (http)
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $NEW:80
iptables -t nat -A POSTROUTING -p tcp -d $NEW --dport 80 -j SNAT --to-source $ME

#port 443 forwarding (https)
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination $NEW:443
iptables -t nat -A POSTROUTING -p tcp -d $NEW --dport 443 -j SNAT --to-source $ME