How to uninstall SSH server in Linux Redhat/Ubuntu?

Some times you in order to make your system more secure you want to stop unwanted service and remove them permanently so that your machine is not compromised. Such service include SSH, FTP etc which should be uninstall if they are not used.

In this post we will see how to stop and uninstall SSH server in Redhat based and Ubuntu based machines.

On Redhat based machine:

Step1: Stop SSH service before uninstalling it.

service sshd stop

chkconfig sshd off

Step2: Remove ssh package from the machine by using below yum command.

yum remove openssh-server

or to completely remove the package as well from the machine use below command

yum erase openssh-server

 

On Ubuntu machines:

Step1: Stop the ssh service before uninstalling it.

/etc/init.d/ssh stop

or

service ssh stop

Step2: Uninstalling ssh server package

apt-get –purge remove openssh-server

That’s it your done with stopping and uninstalling SSH server from Linux Redhat/Ubuntu based machines.

Please comment your thoughts on this.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.