Results 1 to 6 of 6

Thread: SSH port forwarding

  1. #1
    Join Date
    Oct 2013
    Beans
    2

    SSH port forwarding

    Let me start by explaining the goal. I am at my university and I would like to reverse ssh to connect to certain services remotely. I have an EC2 instance that is acting as my server.

    On to the problem. When I ssh to my server like this:
    ssh -R 9091:localhost:9091 [username]@[serverip]
    and at the same time configure firefox and do this:
    ssh -D 8080 [username]@[serverip]

    I can connect to the service running on localhost:9091. However when I point my web browser to [serverip]:9091 with no proxy I get nothing. If someone could explain what I am doing wrong that would be wonderful.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: SSH port forwarding

    I';m pretty good with ssh and port forwarding, but after reading your post twice, I don't understand what you are trying to accomplish. Could you clarify please?

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: SSH port forwarding

    Hi 8RDRrAR.

    It looks like you are trying to access transmission-daemon (because of the port 9091).

    If so, note that by default you can only access the transmission's webui from localhost. In order to enable access remotely, you need to edit the config file located:
    Code:
    /etc/transmission-daemon/settings.json
    then you need enable the white list by changing this field to 'true':
    Code:
    "rpc-whitelist-enabled": true
    and then either add your client IP, or use wildcards to accept connections from anywhere:
    Code:
    "rpc-whitelist": "*.*.*.*"
    Hope that helps. Let us know how it goes.
    Regards.

  4. #4
    Join Date
    Jun 2006
    Location
    Brisbane Australia
    Beans
    713

    Re: SSH port forwarding

    OP, it seems you are trying to do 2 unrelated things there but confused them together. If you want to access the transmission web server (as papibe suggests?) remotely from Uni, then you need a local port forward from client to your server, not a remote port forward which goes the other way. So from Uni:
    Code:
    ssh -L9091:localhost:9091 [username@]serverip
    (i.e. -L, not -R). And then point your browser on your Uni pc to http://localhost:9091.

    Completely separate to this, if you want to tunnel all your Uni pc web traffic via your server (e.g. to get around Uni web blockers etc), then you can use ssh dynamic proxy:
    Code:
    ssh -D 8080  [username@]serverip
    Then configure your Uni PC browser to use a socks proxy on port 8080 to route all web pages etc.

    Of course you can add the -D and -L options together to do both functions via the one ssh session (note that the socks proxy will not intercept localhost requests). Also, if you Uni PC is running Windows then you need to configure the equivalent ssh commands above in PuTTY etc.

  5. #5
    Join Date
    Oct 2013
    Beans
    2

    Re: SSH port forwarding

    Ok to clear things up here the goal is to have my server redirect all traffic coming in on a specific port to a machine behind a firewall. The idea I had was to use a reverse ssh connection and pass the traffic that way. The reason I have both local and remote listed is because when I tunnel my traffic to the server it does work as I would like it, this however does not quite fit my goal.

    Hope this helps:
    This is the idea the cloud server passes all traffic on port 9091 to the Firewalled server (it is transmission for now, but that is only to see if it works. I have another more complex program in mind that uses a similar structure)
    Fire-walled server --Reverse SSH--> Cloud server <--Regular traffic-- Users connecting to my fire-walled sever

    This is how it actually works
    Fire-walled server --Reverse SSH--> Cloud server <--ssh proxy-- me connecting to my fire-walled sever

  6. #6
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: SSH port forwarding

    I'm not sure if I'm getting 100% the right picture, but try this:

    On the Firewallled-Server:
    Code:
    ssh -L 9091:localhost:9091 Cloud-Server
    Then on the remote client machine:
    Code:
    ssh -L 9091:localhost:9091 firewallled-Server
    Then, in the remote client machine, if you open your browser here:
    Code:
    localhost:9091
    It should work.

    What this does is to route transmission's webui from the Cloud-Server to the firewallled-Server, and then to the remote client machine. Is that it?

    Let us know if we are getting closer
    Regards.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •