Using the command ssh -v -R 2255:localhost:2255 firstname.lastname@example.org I was trying to figure out why remote port forwarding wasn't working until I realized GatewayPorts yes was not present in my host's sshd_config. Once I added that, it worked successfully.
Is there a way I could have diagnosed this?
The SSH even output the following (without GatewayPorts yes):
debug1: Remote connections from LOCALHOST:2255 forwarded to local address localhost:2255
debug1: channel 0: new [client-session]
debug1: Requesting email@example.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype firstname.lastname@example.org want_reply 0
debug1: remote forward success for: listen 2255, connect localhost:2255
debug1: All remote forwarding requests processed
When you specify 2255:localhost:2255 fills the missing hostname in front as a localhost. This will really bind only to localhost address (loopback). If you want to use it also "from outside", you need to use the server IP for the remote port forwarding, such as example.com:2255:localhost:2255.
The correct answer for me were both the answers of Jakuje and noraj combind:
You need to specify the remote bind address in addition to the remote port to -R (i.e. -R '*:$REMOTEPORT:$LOCALADDR:$LOCALPORT'). If you don't specify the address, sshd will only bind to the loopback interface (by default).
By default, it seems, /etc/sshd_confing's GatewayPorts [defaults to no]. You should set it to yes to forcefully expose forwarded ports or clientspecified to allow the client to choose. I prefer the latter.
Once set, my server exposed the forwarded service as expected.
If you're still having trouble, you can check how sshd is actually binding the external port (e.g. ss -a) and whether the exposed port is being blocked by a local or upstream firewall.