Configuring a Debian server to run from home.
- March 18th, 2010
- By trq
- Write comment
Over the next few days (hopefully) I’m going to document the process of setting up a dedicated vps server to run from home. I’ve done this a few times before, but have never really gotten around to documenting anything. I’ve a spare box, the need and a little time at my disposal so this time I’m going to give it a go.
Currently I run a few small development wiki’s, issue tracking applications, subversion & this blog from some vps’s (openvz) running on my desktop machine. While this has been a pretty good setup for the last six months or so, I want to get back into making some music and so have the need to run this desktop machine as a dual boot GNU/Linux / Windows machine. In doing so, I’m going to need to shutdown Linux on occasions and seeing that I have people relying on some of the services available on this machine, its time to move on.
I’ve has an old machine (2.6Ghz 1G memory) laying around since it blew a graphics card some 18 months ago. Ive since (last weekend) installed an old card, and she is running again. Ive no spare monitor however, so this will be a headless machine – sitting in the corner of my study (I where I also have a small UPS setup).
At this point in time I’ve done nothing but plug my desktop machine’s monitor into this new (old) machine and do a pretty standard Debian (Lenny) install from a net-install CD. I setup a static IP, when prompted for a host name, I named the machine vpshost, and let it know it was on a domain named lcl. I then also set myself up a user account on this machine called thorpe. When prompted to install any software I deselected desktop machine and simply left standard highlighted. I’ll manually install what I need.
The machine rebooted and I log in as root. The first thing I need to do is update the apt cache, upgrade any old packages & install some essentials.
root # apt-get update && apt-get upgrade
root # apt-get install vim vim-scripts ssh sudo
The first thing I do is reconfigure ssh to use a non standard port & restart the service.
root # sed "s/22/1904/" /etc/ssh/sshd_config && /etc/init.d/ssh restart
Update the alternatives system to use vim as the default system wide text editor.
root # update-alternatives --set editor /usr/bin/vim.basic
Execute….
root # visudo
and un-comment the line that reads %sudo ALL=NOPASSWD: ALL. Place my user (thorpe) into the sudo group.
root # gpasswd -a thorpe sudo
I can now logout and unplug the monitor, putting it back in my desktop machine. Once in my desktop, I added an entry to my dnsmasq server so all the machines on my network can see this machine. I then simply copy over my public ssh key & some handy rc files.
thorpe $ copy-ssh-id
thorpe $ scp .bashrc vpshost.lcl:
thorpe $ scp .vimrc vpshost.lcl:
That’s about it for now. I’ll log in tomorrow and start work.