SSH on a mac

Discussion in 'Mac Basics and Help' started by illy123, Jan 2, 2010.

  1. illy123 macrumors member

    Jan 1, 2010
    Hi everyone,

    I have open SSH running on my linux server at home (which I forwarded to listen on port 443 as port 22 is often blocked).

    When running windows on my laptop I open up Putty; configure it to listen on my domain name, setup the socks proxy and forward a port like 8080. Then I have another profile configured in firefox where it goes through the socks proxy and uses port 8080 to tunnel all internet traffic to my home computer.

    I have tried doing something like this in terminal:

    ssh -P 443 -l 8080 username@mydomainname

    However I am not able to get firefox to use port 8080.

    I would appreciate any help (relatively new to osx).
  2. forum user macrumors regular

    Aug 28, 2008
    Hm, not quite sure if I understand correctly? Your local Mac is running ssh to forward your http traffic to your remote Linux box?

    In Firefox open Preferences, Advanced, Sub-tab Network, click the Settings button, Select Manual Proxy configuration, enter the IP address or hostname of your Mac running ssh, insert 8080 under Port.

    There is also a socks proxy setup on that page.

  3. illy123 thread starter macrumors member

    Jan 1, 2010
    Sorry, I guess I wasn't very clear but you have understood it correctly.

    I am able to configure firefox (I think) - I think the problem may lie in me not knowing the correct line of code to put into terminal.

    I want it to connect to my domain which is on port 443 (I think this part is correct as a simple ssh -p 443 username@domain gives me access to ls the files. However, I want to configure a local port which firefox will go through. On windows I open putty goto the SSH tunnel settings and enter a port number for source port and click on dynamic - I am unsure of how to do this in terminal.

    Thanks for the reply :)

    Edit: Just found this on google will let you know if it works:

    You can use the “-D” flag of openssh to create a SOCKS proxy.

    The command first:
    $ssh -D 9999 username@ip-address-of-ssh-server
  4. nOw2 macrumors regular

    Sep 1, 2009
    man ssh :)

    ssh -p443 -D 8080 me@my.server

    -D creates a SOCKS proxy.

    Or, you can tunnel a port to an existing proxy service:
    ssh -p443 -L 8080:proxy.server:8080 me@my.server
  5. illy123 thread starter macrumors member

    Jan 1, 2010
    Yep, the -D flag!

    I have it working now, thanks very much to both of you.

    Another reason why I love OSX - the mighty terminal!

Share This Page