Minimal Linux distribution with sshd and apt

Solution 1:

If you are inclined to roll your own , you might like using debootstrap. You can quickly make a very very minimal (you'll even need to generate your own locales) distro using it in just a few minutes, based on any distro that uses apt.

Pair it with your kernel version of choice, and you have a very bare bones system.

I prefer using chroot to add what I want prior to copying it over to boot media (you'll need to do that to install ssh / etc)

Solution 2:

First, ps aux gives me a full listing of everything running on the system, including system processes. Did you mean ps ux?

Second, you said that sshd was the only user process running? What about bash? What about ps? That's a user process. The number of running user processes really has no reflection on how few system internals are running; that's why the call it a user process and not a system process.

Third, if sshd is the only system process running, how does did the computer start up (init), or deal with TTY connections (getty or agetty), or log system events (syslogd and klogd)? Truth is, there is a very specific reason for each system process and disabling or kill-ing them can lead to a dumb computer, or a crashed computer.

Udev is pretty much always going to show up in ps listings on any 2.6.xx system. With the move from Kernel 2.4 to 2.6, the udev subsystem is standard unless you compile your own kernel. If you compile udev support out, then you'll have to rely on an unchecked /dev structure, which may cause problems.

If you're really looking to use your own minimalistic Linux install, use Damn Small Linux or Linux From Scratch and only install what you want.

Solution 3:

I'm quite a big fan of Arch Linux for this minimalist kind of installation. I recently set up a VM whose sole purpose was to act as an SFTP repository, separated from my main server. It has a serial and a tty1 agetty running, syslog-ng, udev and sshd.

The nice thing about Arch for this is that it's quite easy to set it up so that very little starts up by default, just edit rc.conf and set these to run like so:

DAEMONS=(syslog-ng network sshd)

With a base Arch installation, I only actually removed the entry to mount network filesystems, and added sshd.

The downside to Arch is that the development libraries are installed with each package, so it's not as minimalist on disk space as an extremely pared down Debian can be. Also, it uses pacman instead of apt so it doesn't really fulfill the stringent requirements of your question, but I do personally feel it's a viable alternative.

Obligatory link to get started, if you're interested: http://wiki.archlinux.org/index.php/Beginners%27_Guide