1835103 Members
1896 Online
110074 Solutions
New Discussion

FTP Serviers

 
Pawan_1
Frequent Advisor

FTP Serviers

We are running HP-UX 11i and wanted to check if someone has started ftp to listen to 2 ports i.e. 21 and some other assigned port at the same time. Thks
6 REPLIES 6
Mel Burslan
Honored Contributor

Re: FTP Serviers

assuming the other port you want to monitor is 20 (if not replace it in the command below)

netstat -a | grep -e 21 -e 20 | grep LISTEN

should give you the list of ports who are actively listening incoming requests.

Caution: it may also list ports like 2121 or 49210 as all grep is doing, is pattern matching, but the output should be much easier to look at that the whole netstat -a output.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Pawan_1
Frequent Advisor

Re: FTP Serviers

Sorry about the confusion. What we need is how to start ftp servers to listen to a different port say 1021 at the same time its listening to its default ports. Thanks
Bill Hassell
Honored Contributor

Re: FTP Serviers

It's a lot easier to just have ftp log it's activities. Change /etc/inetd.conf ftpd line to add the options:

-l -L -u 022

The first -l is to do basic logging, -L shows all the commands and -u 022 sets the umask value for security.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: FTP Serviers

This is not very easy because you can't depend upon the name of the executable to be ftpd. Someone could copy the original or substitute another ftp-like daemon. Only a super-user would be allowed to use the 0-1023 ports.
If it ain't broke, I can fix that.
Pawan_1
Frequent Advisor

Re: FTP Serviers

Its just an example and what I mean any other port also.
Mel Burslan
Honored Contributor

Re: FTP Serviers

On hpux, by default, ftpd does not run like another daemon process. It is initiated by inetd when a request for ftp comes in.

there are two files which control how ftp runs initiated by inetd. These files are /etc/services and /etc/inetd.conf.

again by default, these are configured as follows:
/etc/services
ftp-data 20/tcp # File Transfer Protocol (Data)
ftp 21/tcp # File Transfer Protocol (Control)

/etc/inetd.conf
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -L -l -u 022


if you want the ftp to listen to port 1021 instead of 21, you need to change this info in services file and then restart inetd.

when you say "in addition to" then it becomes a different problem. You need to start an ftp daemon process listening on port 1021 and have it constantly run instead of inetd launching it. I am not sure if this can be done with ftpd provided with hpux.
________________________________
UNIX because I majored in cryptology...