Ssh Vnc Reverse Proxy
VNC Reverse Proxy
In order to create a reverse proxy, you will need access to the server behind the firewall and a computer with a static IP address to proxy/receive the connection from your laptop.
Steps
- Setup - proxy server/computer
- Make sure it has a static IP and that the sshd server is active
- Set the
sshd_config'sGatewayPorts clientspecified- this is used to allow any domain to hit the proxy
- Installation - computer/server behind the firewall
apt install autossh tightvncserver xfce4 xfce4-goodies firefox- store the vnc server password somewhere safe, choose
connection 1as that corresponds toport 5901 - Write a systemd unit for connecting to the proxy
- replace
your_username_herewith your username and1.2.3.4with the IP or DNS hostname of your proxy server - Install the systemd service, restart the
daemon,startit, andenableit.
```[Unit] Description=AutoSSH Tunnel After=network.target
[Service] User=your_username_here Environment="AUTOSSH_GATETIME=0" ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR *:5901:localhost:5901 your_username_here@1.2.3.4 -p 22
[Install] WantedBy=multi-user.target ```
- Connect to vnc server
- use the default mac client
$ open vnc://1.2.3.4:5901 - you should not need to specify a username or anything else
- or use a specialized client
- use the default mac client
Future
- Configure the
tightvncserverservice or pick a different one if preferred. - Consider better macos, windows, linux vnc clients and special configuration options
- Option: per-user vnc connection instead of per user proxy