How to install a bare bones Debian server and remotely manage it via SSH.
I am in the mode to work with Linux a bit more these days so I have decided to setup a bare bones Debian server.
This article is a quick “how-to” on setting up a simple, clean and lean Debian server. Also including setting up SSH to remotely connect to the server.
1. Download Debian ISO
There are a few different types of downloads you can choose from. For our super clean and simple installation, I want the smallest download possible.
For this, I chose the small installation image(netinst) option. This requires your VM (or physical server) to have an active internet connection so it can download the pieces needed that were not included in the download.
For the average VM (or even server), you will need either the amd64 (64bit processor) or the i386 (32bit processor). For my VM I chose amd64.
2. Install Debian 7.4 Wheezy
I will be installing Debian within my VirtualBox environment hosted on my main desktop.
I will assume you have VirtualBox installed or a physical server ready to go. If you need to setup VirtualBox, there are many free articles available on the web that can help you get started. If you want to see how I setup my VirtualBox enviornment, check out my tutorial series titled Building the Ultimate VirtualBox Lab.
My VirtualBox settings for this Debian installation:
- 2 CPU
- 1024 MB RAM
- 8 GB HDD (VDI)
- Network: Bridged
- Floppy from boot order.
The installation is very simple these days. Start the VM and run through the normal options. Most of the options I left default except for a few:
- Domain name: I made up one: pc-addicts.internal
- Software selection: I unselected ALL options.
3. Configure Debian Network Interface
By default Debian’s network interface is configured to use DHCP to automatically receive an IP address, network mask, and gateway. Since this is a server, I want to statically assign the IP information.
We need to edit the interfaces configuration file at /etc/network/interfaces.
In order to edit this file, we need to switch the user account we are using from the standard user to root.
Next we are going to use Vim to edit the /etc/network/interfaces file.
Need help using Vim? Check out this nice Vim tutorial.
Your configuration will most likely be a little different than mine.
Next we need to restart the network interface.
Now you should be able to ping a web address successfully.
4. Install OpenSSH
Since I rarely work directly on my main desktop these days, I want to be able to remotely manage this new shiny Debian server from my laptop.
For this, we are going to be installing OpenSSH Server on our Debian server.
First let’s update the package database.
Now to install OpenSSH server.
[bash]apt-get install openssh-server[/bash]
Your server should now be listening on port 22 for incoming connections.
5. Remotely Connect Using SSH
Connect to Debian SSH from Mac OS X
Mac OS X has a built-in SSH client that can be used from within Terminal.
At the prompt type: (change the IP to your server’s IP)
Connect to Debian SSH from Windows 8
On Windows I have always used a lightweight program called Putty.
Download the executable and run it.
Fill in the Host Name field with the server’s IP address then press Open.
Login with the credentials and you will be connected.
Question for You
Have you used Linux before? If so, do you remember what distro(s)?