public
Last active

Ubuntu setup

  • Download Gist
setup.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
# wget -O - https://raw.github.com/gist/4211882/<REVISION>/setup.sh | bash
 
# Get updates
apt-get -y update
apt-get -y upgrade
 
# Install build tools
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl git-core mysql-client libmysqlclient-dev libxslt-dev libxml2-dev python-software-properties
 
# Install Ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
tar -xvzf ruby-2.0.0-p353.tar.gz
cd ruby-2.0.0-p353/
./configure
make
make install
cd ..
rm -rf ruby-2.0.0-p353/
rm ruby-2.0.0-p353.tar.gz
gem install bundler --no-ri --no-rdoc
 
# Install node.js
apt-add-repository ppa:chris-lea/node.js
apt-get -y update
apt-get -y install nodejs
 
# Install coffeescript
npm install -g coffee-script
 
# Setup users
adduser ubuntu
usermod -aG sudo ubuntu
 
# Configure ssh keys
echo "Upload your ssh public key"
echo "scp ~/.ssh/id_rsa.pub ubuntu@123.45.67.890:/home/ubuntu/"
read
mkdir /home/ubuntu/.ssh
mv /home/ubuntu/id_rsa.pub /home/ubuntu/.ssh/authorized_keys
chown -R ubuntu:ubuntu /home/ubuntu/.ssh
chmod 700 /home/ubuntu/.ssh
chmod 600 /home/ubuntu/.ssh/authorized_keys
 
# Configure SSH
nano /etc/ssh/sshd_config
service ssh restart

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.