I have a rpi with a mediaserver and a pi with Octoprint in my local network (wlan repeater -> wlan router) and since Im often somewhere else than at home, I want to access those servers from outside the local network. But my routers, neither the repeater nor the router have an option for portforwoarding, is there an option to acsess the pi via ssh or vnc without portforwoarding?

Thanks in advance!

  • google router DMZ ... it leaves the RPi directly exposed to the internet though ... or get another router that does have port forwarding and connect it to the DMZ
    – jsotola
    Sep 14, 2020 at 3:10

2 Answers 2


Assuming you are running the standard Raspbian Operating System then you can use VNC to access the Pi without Port Forwarding.

  1. Set up the Pi
  2. Enable VNC
  3. Create an account at RealVNC free of charge - you need a real email address
  4. On the VNC web site create a team
  5. On the Pi log in to VNC using the icon at the top right of the screen

You can now connect to the Pi by logging in to the browser and the REalVNC site. Note if this is a new browser OR you have cleared cookies then RealVNC will send you an email to the account address to verify it is you.

See this KB from RealVNC for more info (esp for rendering issues).

Please note this instructions are from memory and may be a little wrong - do not think I have set one up for a year or so...


Assuming your router has ssh support then put the following into your .ssh/config file:

Host / ProxyCommand ssh -o ProxyCommand=none %r@$(dirname %h) -W $(basename %h):%p

You can then access the Raspberry Pi using

ssh user@router/raspberry

This will first connect to router and then establish another connect from the router to the raspberry and forward your traffic.

Note: This works with any hosts and even multiple times. E.g. ssh user@router1/router2/router3/client. You just need to have the above in the config on each system.

If your router does not support ssh logins and router DMZ or RealVNC isn't to your liking you could set up ssh as tor hidden service instead. It's more complex and you need tor on your laptop and Raspberry Pi. But it will be secure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.