docker-traefik icon indicating copy to clipboard operation
docker-traefik copied to clipboard

Exposing SSH Port 22 for SFTP via Traefik

Open rondobohrens opened this issue 5 years ago • 3 comments

Hey all,

I am currently wrestling with exposing port 22 of my Synology server via traefik's tcp routers in order to provide sftp capabilities when on the go.

The only helpful resource I have found so far is this: https://community.containo.us/t/routing-ssh-traffic-with-traefik-v2/717

However, implementing this solution does not seem to work for me - I configured port 22 as ssh entrypoint, and used tcp routers in order to forward traffic to port 22 of my server, but something does not work correctly.

I adjusted the entry point in our general docker-compose file:

      - --entryPoints.ssh.address=:22

My toml file looks as follows:

[tcp.routers]
  [tcp.routers.mount-rtr]
      entryPoints = ["ssh"]
      rule = "HostSNI(`*`)"
      service = "mount-svc"
	  middlewares = ["chain-no-auth"]

[tcp.services]
  [tcp.services.mount-svc]
    [tcp.services.mount-svc.loadBalancer]
      passHostHeader = true
      [[tcp.services.mount-svc.loadBalancer.servers]]
        address = "192.168.0.122:22//"

Could anyone kindly point me in the right direction/to a useful part of the documentation to debug/solve this problem?

Thanks!

rondobohrens avatar Aug 17 '20 15:08 rondobohrens

Hello @rondobohrens ,

have you tried a different port (e.g. 2222)? My guess is that Synology has the SSH daemon listening on port 22 so Traefik cannot use the same port as entry-point.

GZ

gzecchi avatar Aug 26 '20 15:08 gzecchi

@rondobohrens Did you ever get this working?

robflate avatar Oct 27 '20 12:10 robflate

Unfortunately no, I just circumvented it and expose it on another domain that I do not manage with traefik. But I will probably also try my luck with Guacamole in the next weeks.

rondobohrens avatar Nov 11 '20 09:11 rondobohrens