1821413 Members
2605 Online
109633 Solutions
New Discussion юеВ

Change port FTP

 
Ana Ramirez
Occasional Contributor

Change port FTP

Hello all the people!!!!
I have a question that may sound simple for you, I started 2 months ago in UNIX, and I would like to change the access port from 21 to xxxx. Anyone know how to accomplish this?

For security rules I have to blocked port 21, but I need another port in order to have a FTP conection... that's the reason that I need to add another FTP port, but it dosn't be port 21


Thank you very much in advance.
4 REPLIES 4
Mel Burslan
Honored Contributor

Re: Change port FTP

edit /etc/services file
look for the line containing

ftp 21/tcp

line

change 21 to the port number you desire.
then execute command

inetd -c

to reread the inetd configuration you just modified.

make sure the new port you specified, is not blocked by firewall for some other reason. Better yet, talk to your firewall/security admins to find out an open port as usually, the firewall rules are setup as "block all, open only required ports."
________________________________
UNIX because I majored in cryptology...
Michael Jorgensen
Esteemed Contributor

Re: Change port FTP

ftpd reads the /etc/services to find the port number on HP-UX, at least according to the manpage for ftpd.

Are you trying to modify the OS ftp server? Or a separately installed ftp server (e.g. pure-ftp or wu-ftp?)?

If the standard one you should be able to modify /etc/services and change the ftp line to have your new port number.

Then kill -HUP the inetd process to force it to read the config file.

And you're done... I will put a disclaimer on this that it has been a while since I did HP-UX admin so try this on a test machine first.
Arunvijai_4
Honored Contributor

Re: Change port FTP

Are you using in-built FTP server ? If yes, you can do it by editing /etc/services and do # inetd -c will restart Internet Daemon without affecting your network.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Biswajit Tripathy
Honored Contributor

Re: Change port FTP

Ana,
It's really a bad idea to try to go around your
security settings like this.

A better solution would be to configure the
firewall to allow FTPs only from few authorized IP
addresses and block everyone else. And make
sure the access is logged by the firewall so that
unauthorized attempts are recorded.

- Biswajit
:-)