I want to stop ftp and remove the service on Ubuntu 14.04
I tried sudo apt-get remove ftp
and checked using command ps aux | grep ftp
but the service was still running.
Please suggest some way to stop it.
I want to stop ftp and remove the service on Ubuntu 14.04
I tried sudo apt-get remove ftp
and checked using command ps aux | grep ftp
but the service was still running.
Please suggest some way to stop it.
To stop the service:
sudo service vsftpd stop
To remove the service
sudo apt-get remove vsftpd
I don't know why I did not spot this earlier. I've left my other answer alone to avoid confusion
There is no FTP service
What you are seeing when you are running ps aux | grep ftp
is the process of the same command.
There are better ways of searching the process using the commands pgrep or pidof. Simple way to run these:
pgrep ftp
pidof ftp
In both cases will simply return the PID if there is a process running of the name given or nothing if no process found of the given name.
First of all you will have to identify which FTP server you are running because there are a lot (vsftpd, pro-ftpd, ...). I suggest that you do dpkg -l|grep ftpd
to see which FTP daemon is installed.
The name of the service to use is usually the name of the displayed package without the version number, e.g. proftpd or pure-ftpd or anything other depending of your installation.
When you have identified in the output the name of the FTP server package, just do :
sudo stop <name>
if you get an error like <name>: unknown job
this is because is not upstart enabled. Then simply try :
sudo service <name> stop
Then, just remove the package using the standard command :
sudo apt-get remove <name>
or (if you want to get rid of all config files and so on) :
sudo apt-get purge <name>
For Ubuntu 20.04 ( and if you are installed vsftpd
)
$ sudo systemctl stop vsftpd
will stop the service
then...
$ sudo apt-get remove --purge vsftpd
Firstly check which package/service is responsible for your FTP service:
$ service --status-all 2>&1 | grep ftp
[ - ] proftpd
If it's still not clear, check by:
sudo netstat -ap | grep ftp
Then remove it (apt
will automatically stop the service):
$ sudo apt-get remove proftpd-basic
Removing proftpd-mod-vroot ...
Removing proftpd-basic ...
[ ok ] Stopping ftp server: proftpd.
If it's not proftpd
, then change to whatever package which deals with your FTP service.
Test with telnet
:
$ telnet localhost ftp
If you've got Connection refused
, then your server is more secured.