I'm new to Linux and my boss told me to remove ssh server as we don't need to provide the remote login and file transfer capabilities of SSH. How do I disable and remove OpenSSH server?
You can disable and remove the OpenSSH server and its configuration using the following commands.
Linux: RHEL / CentOS / Fedora / Red Hat / Scientific Linux Delete SSH Server
Type the following commands as the root user (you must login using either server console or remote login using KVM over IP/IPMI):
# chkconfig sshd off
# service sshd stop
# yum erase openssh-server
You need to edit and update firewall rules that allows inbound connections to SSHs tcp port # 22. Edit /etc/sysconfig/iptables and /etc/sysconfig/ip6tables. In each file find and delete the line that access connection to port # 22. A sample entry:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
Save and close the file. Restart the Linux firewall:
# service iptables restart
# service ip6tables restart
Linux: Debian / Ubuntu Linux Remove SSHD Server
Type the following commands:
# apt-get --purge remove openssh-server
Again, you need to edit and update firewall rules or firewall shell scripts that allows inbound connections to SSHs tcp port # 22.
FreeBSD Unix Disable OpenSSHD Server
Freebsd and may other Unix like operting system install OpenSSH server as part of base system. In other words you simply can not delete binary package. First, stop sshd service, enter:
# /etc/rc.d/sshd stop
To disable openssh, edit /etc/rc.conf file and located the following line:
sshd_enable="YES"
To disable sshd, enter:
sshd_enable="NO"
You can rebuild your FreeBSD base system without OpenSSH. You need to edit /etc/src.conf and set WITHOUT_OPENSSH to yes:
WITHOUT_OPENSSH=yes
See Freebsd handbook and src.conf man page for more information.
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 0 comments… add one now }