# Using Xinetd



## cryingvalor (Nov 4, 2006)

Hey guys i just configured xinetd in my ubuntu box which also runs a vsftpd server and i configure the ftp service in xinetd. My question is if the xinetd daemon is running then the ftp(vsftpd) daemon doesnt necessarily to be running simultaneously with xinetd, xinetd will just run and stop the ftp daemon when necessary?


----------



## lensman3 (Oct 19, 2007)

Yes. The xindtd daemon starts and stops the vsftpd daemon on an as-needed basis. But the xindtd must always be running for ftp to work. I think, but I'm not sure, that xindtd daemon is smart enough to start a second occurrence of ftp if a second person tries to connect.


----------



## cryingvalor (Nov 4, 2006)

hello sorry for the very late reply....:grin: i dont know whats wrong but i cant connect to my vsftpd if xinetd is running and the vsftpd daemon is off, i can only connect if vsftpd is also running, which now i conclude that xinetd is not working but my configuration on my xinetd is good i dont see any problems... what could be wrong?


----------



## lensman3 (Oct 19, 2007)

I'm running Fedora Core 8 on a 64 bit machine.

Here is my ftp config file in /xinetd.d/vsftpd file in xinetd.d: 
permissions are -rw-r--r-- and root-root is the owner-group

service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/vsftpd
server_args = /etc/vsftpd/vsftpd.conf
nice = 10
disable = no
flags = IPv4
}


See if your stuff looks like mine.


----------



## lensman3 (Oct 19, 2007)

OK hack time. We are going to see if xinetd daemon is working.

Edit the file /etc/xinetd.d/echo-stream and change the 6th to " disable = no". Restart the xinitd daemon by "/etc/init.d/xinetd restart". This is done on the host that has the ftp daemon running.

Now the hack part, type in "telnet 127.0.0.1 7". Substitute 127.0.0.1 for the number of the host that has the ftp daemon on it. Make sure of the 7 is at the end. The previous paragraph edit opens up the rpc built-in daemon for the internet echo mirror. You might have to disable your firewall 

Now type garbage at it, and it will echo exactly what you type. To exit you will have to cntrl-]-D to get back to the telnet prompt (or kill the window which has no finesse). If xinitd daemon is running you will see echo's. If not then something is wrong with it and it needs fixed.


----------



## cryingvalor (Nov 4, 2006)

ok, first i copy your configuration for your ftp, then when i try to connect using a ftp client, there is an error saying that the connection is established but could not bind listening IPv4 socket, then i was about to do your latest sugestion but i have a problem with my telnet connection "telnet 127.0.0.1: is being refused.


----------



## lensman3 (Oct 19, 2007)

The first message sounds like a ftp daemon is listening on ports 20 and 21. If you kill the ftp daemon that error should go away.

Instead of "telnet 127.0.0.1", try "telnet 127.0.0.1 25". This will connect to the sendmail daemon (port 25-smtp). By default, the telnet server is not started automatically for security reasons which could give the error "connection refused". You need to "telnet" onto a port that is listening and sendmail should be listening. You should get a "HELO" from the sendmail daemon. Type "HELP" to get the quit or exit command name. If all fails, stop your firewall ("/etc/init.d/iptables stop"). Don't forget to later restart it.


----------



## cryingvalor (Nov 4, 2006)

> The first message sounds like a ftp daemon is listening on ports 20 and 21. If you kill the ftp daemon that error should go away.


The ftp daemon is already stop when i get the error message.



> "telnet 127.0.0.1 25"


this doesn't work and i have no iptables running confused:


----------

