port problems

Roadie

Registered
ok, heres my situation:

3 computers behind a router: an imac (ip: 106), a g4(111) and a pc (108).

Now, the imac is an ftp server...but, i also want to have ftp access to the g4.

I've opened up port 21 on the router to send the ftp traffic to the imac (that's working fine). I am trying to open up a different port (i am trying 2121) to get to the g4, but it's not working. All I get is connection refused messages (I am using transmit to try and log in).

The g4 has all its sharing options started, and its built-in firewall is off.
 
i tried finding a way to set the default server for os x to listen to a different port, but it turned out to be a giant pain in the ass.
 
Doesn't ipfw allow you to set up port redirects? I kinda remember reading something along those lines in the man pages ...
C
 
its the firewall built into OS X. (IP FireWall). Taken from the FreeBSD system Darwin is based on. The stuff you can specify in the System Prefs is only a small subset of what the firewall is actually capable of. Check out the man pages on how to check the entries for the firewall, activate it in Sys Prefs, and then have a look what kind of effect that's had on the entries - its a good way of quickly getting familiar with what it does. Then you could have a go at setting up port forwarding with it :)
Cheers,
C
PS: I'd post actual examples, but its ages since I looked at all this, and I've forgotten it all again :(
 
i checeked it out, im not sure if what that does is what i want. i was doing more research and i looked like ftpd or something like that would be my best bet. do you know anything about that?
 
ftpd is the FTP daemon program (but you probably knew that). There should be a way to configure it to use a different port ... by default it uses 21 (a 'well known port' as they're called). Traditionally in Unix all configuration is done in files under the /etc directory, however Mac OS X uses NetInfo for configuring many things which traditionally are under the /etc directory. However, in later releases of OS X it is possible to configure things under either.
Your best bet is checking the man pages or the info pages for where and how to configure what in order to get FTP to listen to a different port. Once you have it configured to that port, you'll have to make sure that all your firewalls allow that port through and that your router is forwarding that port to your machine.

My original thought was that you could configure the ipfw firewall to forward incoming requests on port 2121 to port 21. I vaguely remember that that should be possible.

(I've just had a quick flip through the ftpd man pages, and it looks like everything you need to know is in there).

Cheers,
C
 
Try this:

In /etc/services add the following:

ftp-data 2120/udp
ftp-data 2120/tcp
ftp 2121/udp
ftp 2121/tcp

Then comment out the following
ftp-data 20/udp
ftp-data 20/tcp
ftp 21/udp
ftp 21/tcp

Then:

sudo killall ftpd
sudo ftpd

That will change the ftp port from 20/21 to 2120/2121

look at the ftpd(8) man page.
 
Back
Top