SSH Tunneling


Backgrounds

Now as you have set up vpn, you still cannot access to all servers at home via normal ssh or normal rdp or normal vnc.

You need to connect to the vpn server first, then access other servers at home.

Remmina

  1. Turn on your VPN.
  2. Create a new session, VNC protocol. Set up Basic settings normally.
  3. At SSH Tunnel tab, enable SSH Tunnel → Custom: ip:port → Authentication type: Password → Username and Password. Now you can connect.

Terminal


ssh -J username1@ip1 username2@ip2
# enter first user password then second
    

Android to VNC with SSH Tunnel: bVNC Free

  1. Turn on VPN.
  2. Connection Type: Secure VNC over SSH
  3. SSH Tunnel Settings
  4. 
    ip port(default:22)
    username # later it will ask your password
        
  5. VNC Connection Settings
  6. 
    ip port(default:5900)
    username
    password #keep yes
        

Android to SSH with base SSH: JuiceSSH

  1. Turn on VPN.
  2. Basic settings
  3. 
    Type: SSH
    Address: ip
    Identity: username + password
        
  4. Advanced settings
  5. 
    Port: 22
    Connect via: base ip
        

Notes

flowchart LR; z[Wifi Router 192.168.1.1]; subgraph a[Laptop 192.168.1.112] a1[port 6666] end subgraph b[Pi 192.168.1.111] b1[port 5901] b2[dns 192.168.4.1] end z-->a; z-->b; subgraph c[PC 192.168.4.73] c1[port 5900] end a1 -->|ssh| b1; b2 -->|provide internet| c; b1 -->|ssh| c1;

# In Pi,
ssh -L 5901:localhost:5900 user1@192.168.4.73
# In Laptop
ssh -L 6666:localhost:5901 pi@192.168.1.111
# Try VNC Viewer localhost:6666
    

References


  1. SSH Local and Remote Port Forwarding with VNC