Note: This post was created awhile back on another platform and I migrated to my current one.
Setting Up a Debian (Lenny) Server on Linode
This tutorial is a refined version of the SliceHost guide for setting up a Debian 5.0 (Lenny) server.
Why a Virtual Server?
If you need a web server without paying for a dedicated physical machine, a virtual private server (VPS) is a great alternative. After comparing different providers, I chose Linode because they offered more RAM for the price.
Server Setup Steps
1. Load Debian Lenny Image
Using Linode’s manager, load up Debian Lenny’s image and set up the root password.
2. SSH into Your Server
For Windows users, download PuTTY to connect via SSH.
Example:
|
|
Basic Configurations
3. Enable Color Console
Color in the terminal helps differentiate files, directories, and commands.
- Navigate to the root directory:
1
cd /root
- Edit
.bashrc
:1
nano .bashrc
- Add/uncomment the following:
1 2 3 4 5 6
# Enable colorized ls export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA'
4. Create a New User with Root Privileges
Using root
all the time isn’t safe. Create an admin user instead:
- Create an
admin
group:1
groupadd admin
- Edit sudoers:
Add the following line:
1
visudo
1 2
## Allows people in group admin to run all commands admin ALL=(ALL) ALL
- Add a user to the group:
1 2
adduser anthony usermod -a -G admin anthony
- Switch to the new user:
1
su anthony
5. Secure SSH Configuration
Edit the SSH config file:
|
|
Modify these lines:
|
|
Restart SSH for changes to take effect:
|
|
Firewall (iptables) Setup
6. Check Current Firewall Rules
|
|
If no rules exist, add some:
7. Create a Firewall Rules File
|
|
Add the following:
|
|
8. Apply the Firewall Rules
|
|
Check the applied rules:
|
|
9. Persist Firewall Rules After Reboot
Create a script:
|
|
Add:
|
|
Make it executable:
|
|
To back up current rules:
|
|
Other Configurations
10. Set Server Timezone
|
|
Follow the on-screen menu.
11. Set Server Locale
|
|
Select en_US.UTF-8 UTF-8
or another preferred locale.
Domain Name Setup
I registered my domain with GoDaddy. During setup, I provided these Linode name servers:
|
|
Conclusion
This guide helps you set up a Debian (Lenny) server on Linode securely, including SSH hardening, user management, and firewall setup. You can now proceed with hosting your applications.