In this tutorial, we will show you how to replace OpenSSH with Dropbear on CentOS. For those of you who didn’t know, Dropbear is a relatively small SSH server and client. It runs on a variety of POSIX-based platforms. Dropbear is open-source software, distributed under an MIT-style license. Dropbear is particularly useful for “embedded”-type Linux (or other Unix) systems, such as wireless routers.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step replacement of Dropbear SSH in the CentOS server.
Prerequisites
- A server running one of the following operating systems: CentOS Linux.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Replacing OpenSSH With Dropbear on CentOS
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo yum clean all sudo yum update
Step 2. Replacing OpenSSH With Dropbear on CentOS system.
To install, first, you must add the yum repository information corresponding to your CentOS/RHEL version to yum:
- For CentOS 6.x use:
#wget http://dl.fedoraproject.org/pub/epel/6/i386/dropbear-0.58-1.el6.i686.rpm #rpm -Uvh dropbear-0.58-1.el6.i686.rpm
- For CentOS 5.x use:
#wget http://dl.fedoraproject.org/pub/epel/5/i386/dropbear-0.55-1.el5.i386.rpm #rpm -Uvh dropbear-0.55-1.el5.i386.rpm
First, we will just install dropbear using yum:
#yum install dropbear
Now we just need to start up a new SSH server:
nano /etc/init.d/dropbear
Edit port dropbear:
OPTIONS=" -p 222"
Add dropbear to startup and start the server:
chkconfig dropbear on service dropbear start
Next, you can stop the current OpenSSH server:
yum remove openssh-server
Note: Make sure you check that it is indeed running and verify from another box before you log out of your current session otherwise.
Congratulations! You have successfully installed Dropbear. Thanks for using this tutorial for installing Dropbear SSH in the CentOS system. For additional help or useful information, we recommend you to check the official Dropbear website.