ddev / ddev-addon-template

Template for DDEV add-ons.
Apache License 2.0
17 stars 17 forks source link

Configure tmate port number #44

Closed tyler36 closed 7 months ago

tyler36 commented 7 months ago

Maybe beyond the scope of this addon.

I tried to follow the instructions to debug an addon but get a nyc1.tmate.io port 22: Connection refuse error.

Is the tmate port configurable with this addon? Is this something we can enable, document?

The website talks about ~/.tmate.conf and using:

set -g tmate-server-port 22

I had issues previously with Gitpod and port 22. It is not uncommon for IT departments to block 22 for "security reasons".

rfay commented 7 months ago

I use this all the time without trouble. Is port 22 blocked in your environment? Can you ssh to other hosts on the internet? It's not uncommon for local firewalls to block 22. When it does, you can use a jumphost to access via another port, but that would be fairly annoying for this usage.

rfay commented 7 months ago

Try ssh rfay@jumphost.thefays.us - you won't be able to get in, but it should connect.

tyler36 commented 7 months ago

It does not connect.

$ ssh rfay@jumphost.thefays.us
ssh: connect to host jumphost.thefays.us port 22: Connection refused
rfay commented 7 months ago

You might consider asking your IT folks to allow it, it's a very normal thing, and of course since sshd can be on any port, it's quite naive to block just port 22.

Otherwise you can do what I do an have a jumphost to do the job, but I think you might have to configure it for every tmate session. I use a cheap VM for this (jumphost.thefays.us)

Actually, it's easier than I was thinking. You can just get to somewhere outside your system on the internet and use the tmate URL there. If you'd like me to allow you to use jumphost.thefays.us I will. Basically you just need an internet host that you can access that's outside your local network, get there, use the ssh URL provided by tmate.

Of course, check with your IT department to see if this is allowed behavior. Best case is get them to explicitly allow it.

rfay commented 7 months ago

I guess you sorted that out before I even responded, and I fully encourage you to try out the tmate instructions for using a different port.

tyler36 commented 7 months ago

I will play around and see what I can do.