Anyone who opens an SSH account using OpenSSH knows that opening an SSH account takes up two session processes and occupies about 8 MB of memory. This makes VPs with low memory hard to run, the number of accounts that can be opened is greatly reduced.
I found some materials and methods on the Internet. After testing, I found that the use of lightweight dropbear to replace OpenSSH memory is significantly reduced, and an SSH account only occupies 2 MB of memory.
We will share with you how to replace OpenSSH with dropbear. This method uses centos 5.5 of Linux:
1. do two things before installation:
1. If the port of OpenSSH is still 22, you need to modify it.
VI/etc/ssh/sshd_config
Modify the port in the first few lines of the configuration file:
Port 2269
# Protocol 2, 1
Save and restart:
Service sshd restart
2. installation package:
Yum install zlib * GCC make
II,
1. Download, decompress, compile, and install the latest version of dropbear:
Wget http://matt.ucc.asn.au/dropbear/releases/dropbear-0.53.1.tar.gz
Tar-xvzf dropbear-0.53.1.tar.gz
CD dropbear-0.53.1
./Configure
Make & make install
2. Configure dropbear
Generate host key:
Mkdir/etc/dropbear
/Usr/local/bin/dropbearkey-t dss-F/etc/dropbear/dropbear_dss_host_key
/Usr/local/bin/dropbearkey-t rsa-s 4096-F/etc/dropbear/dropbear_rsa_host_key
After configuration, start dropbear:
/Usr/local/sbin/dropbear
Set to auto start upon startup:
VI/etc/rc. Local
Add a line at the end:
/Usr/local/sbin/dropbear
Iii. Supplementary description of dropbear:
The default installation path of dropbear is/usr/local/sbin.
The default port of dropbear is 22. To listen to other ports, run the following command:
/Usr/local/sbin/dropbear-P 2222
Change the default listening port method:
Run the following command before compiling dropbear (replace 2222 with the desired port ):
Sed-I's/22/2222/G' options. h
If you have any questions, see help:
/Usr/local/sbin/dropbear-H