Skip to content

Instantly share code, notes, and snippets.

@craiga
Last active October 6, 2015 12:28
Show Gist options
  • Save craiga/2993306 to your computer and use it in GitHub Desktop.
Save craiga/2993306 to your computer and use it in GitHub Desktop.
Setting up a debuntu server
# get ip address to put into your workstation's /etc/hosts
sudo ifconfig eth0
# set up ssh (courtesy of Doug)
sudo aptitude install openssh-server
sudo sed -i 's/^ChallengeResponseAuthentication.*$/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
sudo service ssh restart
# tab completion
sudo aptitude install bash-completion
# cURL and wget
sudo aptitude install curl wget
# set up passwordless ssh
mkdir ~/.ssh
# run cat ~/.ssh/id_rsa.pub | pbcopy on your workstation, then paste into this file
vi ~/.ssh/authorized_keys
# also need to add "ForwardAgent yes" and possibly a "User" line to ~/.ssh/config on your
# workstation
# make debian startup a bit faster (courtesy of Doug)
sudo sed -i 's/^GRUB_TIMEOUT.*$/GRUB_TIMEOUT=1/g' /etc/default/grub
sudo update-grub
# apache?
sudo aptitude install apache2
sudo a2dissite 000-default
sudo a2enmod rewrite ssl include # you might want to edit this list
# you probably want to a2ensite something here
sudo vi /etc/apache2/conf.d/server-name # enter "ServerName localhost" into this file
sudo service apache2 restart
sudo chmod a+x /var/log/apache2
sudo chmod a+r /var/log/apache2/*
# nfs
# run "usermod -u workstation-uid local-username" where workstation-uid is the workstation user's
# UID and local-username is…well, the local username.
# run "id" to get workstation-uid
# you'll need to do this as root and local-username cannot be logged in; it will probably be
# necessary to "sudo shutdown now" and do the above from the VM console
sudo aptitude install nfs-server
sudo vi /etc/exports # paste "/ *(rw,no_subtree_check,insecure)" into this file
sudo service nfs-kernel-server restart
# set up ntp to keep system clock up-to-date
sudo aptitude install ntp
# remove stuff which is sometimes installed that we'll never use
sudo aptitude remove postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment