Starting/Stopping FTP server from commandline?

michaelsanford

Translator, Web Developer
For added security I prefer only to start my FTP server when I need to (that is, when I'm away from my computer and need to transfer large files).

How do I start and stop the FTP server from the command line? I've got the default one that comes with 10.1.5.

For that matter, what server does it use?
 
I'm not sure about 10.1.5 but 10.2.4 uses the xinetd daemon. So in the file /etc/xinetd.d/ftp

service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/libexec/ftpd
server_args = -l
groups = yes
flags = REUSE
}

You can set the disable flag, then you probably have to. kill -HUP `cat /var/run/xinetd.pid`
This (i think) can only be done as root or whith sudo.
There can very well be an easier way to do this that I don't know of.
 
Cool you led me straight to the answer (which for 10.1.5 is a little different):

All of the services in 10.1.5 seem to be listed in /etc/inetd.conf with line items like
Code:
ftp     stream  tcp     nowait  root    /usr/libexec/tcpd               ftpd -l
So all I did is comment out (or uncomment, as the case may be) the ftp service, and then send a HUP signal to inetd.

I wonder why it seems so much simpler in inetd than xinetd for Jag (single file for all services instead of multiple files).

Also I noticed that 10.1.5 calls the tcpd access controller, and 10.2 calls the ftpd server directly (or perhaps it does call tcpd automatically)?

Anyways it works now.
Thanks!
 
Back
Top