32MB.CN

Handmade Clean and Streamlined Debian VPS System
1.upgrade systemapt-get update&&apt-get upgrade 2...
扫描右侧二维码阅读全文
12
2015/10

Handmade Clean and Streamlined Debian VPS System

1.upgrade system

apt-get update&&apt-get upgrade

2.remove useless packages

apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin
These packages will auto start on system startup.
apache2-* // apache service
bind9-* // a name server implementation with its own configuration file format
xinetd // xinetd (extended Internet daemon) is an open-source super-server daemon
samba-* // a collection of programs that implements the Server Message Block (commonly abbreviated as SMB) protocol for UNIX systems
nscd-* // name service cache daemon
portmap // an Open Network Computing Remote Procedure Call (ONC RPC) service
sendmail-* //an alternative Mail Transport Agent (MTA)
sasl2-bin //administration programs for SASL users database

3.Replacing OpenSSH with Dropbear(Optional)
First we will just install dropbear using apt-get, there is no point in installing it from source:

sudo apt-get install dropbear

Now we need to do some very basic configuration to dropbear, so open up the configuration file in a text editor.

sudo nano /etc/default/dropbear

Look for the line NO_START and replace with what’s below, once you have done that just hit ‘ctrl + x’ to exit and answer ‘y’ to saving the file (if you used nano that is):

NO_START=0

Next we can kill the current SSH server so the SSH port (22 TCP) isn’t already in use, you will NOT lose your SSH connection by running this command:

sudo /etc/init.d/ssh stop

Now we just need to start up our new SSH server, this should work as there is no longer the other SSH server running on port 22.

sudo /etc/init.d/dropbear start

Now it’s a good idea to test the new daemon and just make sure you can actually make a connection, so keep you current SSH connection open (if this doesn’t work that’s your only access to the server!) and just open a second SSH connection, make sure you can login and get to the root user account without any issues. If for any reason you can’t then just shutdown the dropbear server and start the ssh deamon again (opposite of the above commands).
Finally and only if the testing of the new SSH server worked 100% you can remove the old openssh-server, as we won’t be needing it anymore!

sudo apt-get remove openssh-server

Last modification:October 21st, 2015 at 05:14 pm
If you think my article is useful to you, please feel free to appreciate

5 comments

  1. KEVI

    Interesting!

  2. 菜鸟

    有在32MB内存下安装debian的教程吗?
    还有WEB服务器是用的什么。

    1. 32MB.CN
      @菜鸟

      仅用32mb内存安装新的debian有点强人所难,所以我是安装到128mb内存然后缩减到32mb内存然后制作镜像,这样拿到哪里都能启动,我相信vps商家也是这么做的

  3. 菜鸟

    数据库用的是什么数据库。

    1. 32MB.CN
      @菜鸟

      sqlite

Leave a Comment