|
|
port forwarding with ssh
|
|
|
|
Forum Regular
Join Date: Jul 2002
Location: Ireland
Status:
Offline
|
|
I wish to be able to SSH into my mac remotely but am having some trouble port forwarding...
I have a Netopia router and I can setup port forwarding on it but my housemate has grabbed the mapping to port 22 and the router won't let me add another port mapping to port 22...
So, I need to map to another port, let's say port 9999.
The problem I have is getting my mac's SSH to listen on port 9999. I was hoping to be able to setup some sort of "internal" port mapping to map incoming SSH connections from port 9999 to port 22. This way when my laptop is not behind the router it will still respond to port 22 as normal.
I am using 10.5 and tried the following ipfw command with no luck:
> sudo ipfw add 0 allow tcp from any 9999 to any 22
Any help would be most appreciated!
|
sheesh, that took 8 hours for me to be asked to change my sig...
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: May 2001
Status:
Offline
|
|
I would just uncomment the line in /etc/sshd_config and change the port to 2222 , then restart sshd
edit: looks like there is another config in /private/etc/sshd_config , I would try that one first.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2005
Status:
Offline
|
|
/etc is just a symlink to /private/etc, so they're the same configuration
If I were you, I would just edit that file, uncomment the "#Port 22" line, and add another line after it with "Port 2222" or whatever other port you want. SSH will then listen on both. You'll need to restart the daemon (easiest way would be to just uncheck it in Sharing and recheck it). Of course, you'll need to add access through to port 2222 in your firewall configuration as well.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jul 2002
Location: Ireland
Status:
Offline
|
|
Thanks for the replies. I tried editing the file but I still get connection refused even after a restart. I tried sshing to localhost on my custom port with the same result as well.
I came across this blog post:
http://tektastic.com/2007/08/mac-os-...n-sshd-on.html
I'll try it later today after work
|
sheesh, that took 8 hours for me to be asked to change my sig...
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jul 2002
Location: Ireland
Status:
Offline
|
|
The above blog post method worked for me
|
sheesh, that took 8 hours for me to be asked to change my sig...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|