I\'m trying to generate an SSH server in a machine behind a router.
First I tried to bind the SSH to my public IP address:
ssh -R 10002:localhost:22
Is there a ssh-server running on the public "ip_address"? What you're trying to do is "open ssh connection to "ip_address" and then tunnel any incoming request on port 10002 to localhost:22".
If "ip-address" is the public IP address of your dsl-router, you have to create a port-forwarding in the router's configuration to your host:22.
If you do not have access to the router, the only possible thing would be if you had access to another server running ssh in the internet, from which you can tunnel.
# open a session to the public available machine and create a tunnel from port 10002 back to your local sshd (22)
ssh -R 10002:localhost:22 ip_of_public_server
# as long as this session is open, all calls to the public available machine on port 10002 will be tunneled to your local machine (make sure sshd is running on port 22)
ssh -p 10002 ip_of_public_server