Low-memory VPs replace OpenSSH with lightweight dropbear

Source: Internet
Author: User
Tags vps ssh account dropbear
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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.