1823958 Members
4943 Online
109667 Solutions
New Discussion юеВ

change ftp port

 
SOLVED
Go to solution
marco cochet
Occasional Contributor

change ftp port

goodday again wizards :-)
i now i asked a lot of questions lately
but then again i am a newbie :-(
my os is hp-ux 11.11 with the latest ftp patches.
what i want to ask is how to change the ftp port from 21 to XXXX.
i must do this because my provider dont let me get a connection with another provider.
thanx in advance,
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor
Solution

Re: change ftp port

Hi,



You can manipulate your /etc/services and get it working. However, your client should know the it has to connect to your HP server through the port xxxx otherwise it will get "connection refused" message.

1. Take a copy /etc/services
2. Edit /etc/services. Modify the entries ftp and ftp-data to point to two different ports. Make sure there are no other processes that are using these ports. Search for these ports in the file and do a "netstat -an |grep "\*\.xxxx".
3. Restart inetd. "inetd -c".
4. Do a "netstat -an |grep "\*\.xxxx" and make sure the port is in LISTENING mode.

To test it connect from the localhost. It will connect to xxxx port as it get's the getservbyname from /etc/services.

$ftp localhost

If it works, then your setup is good on the HP server.

Then ask your clients to modify their service lookup files (services) to change the ftp port from 21 to xxxx.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Jim Mallett
Honored Contributor

Re: change ftp port

You're trying to connect to another server? If so, you could do:
ftp
open servername

If you're talking about somebody connecting to you, I haven't tested this yet but logically it should work. You could give it a try:
Edit the ftp line your /etc/services file, it is set at the default port (21). Try putting a different port in there and restart Inet.

Jim
Hindsight is 20/20
marco cochet
Occasional Contributor

Re: change ftp port

worked like a charm
thanks for the quick responces all
Caesar_3
Esteemed Contributor

Re: change ftp port

Hello!

Change your /etc/services file,
change the port of ftp to the wanted
then use this port for connect to the server.

Caesar