-
Notifications
You must be signed in to change notification settings - Fork 495
ubuntu setup
For context, see the general dotfiles installation instructions.
(tested with 14.04.1 LTS)
https://github.com/cowboy/dotfiles/blob/master/ansible/roles/ubuntu.yml
(the default password is "test")
export DEBIAN_FRONTEND=noninteractive && \
apt-get -qq -y update && apt-get -qq -y dist-upgrade
user=cowboy
adduser $user --gecos '' && adduser $user sudo && \
sed -i.bak -r 's/^(PermitRootLogin) .*/\1 no/;$a\\nUseDNS no\nAllowUsers '$user /etc/ssh/sshd_config && \
reload ssh
(you'll need to enter a password)
If anything went wrong, this tab is where you'll fix things! Leave this tab open until everything is done, and you've verified that everything works.
ssh aaa.bbb.ccc.ddd
sudo date
Note: if you're not me, this step will be different. READ THIS BEFORE USING THE FOLLOWING COMMAND!
bash -c "$(curl -fsSL https://bit.ly/cowboy-dotfiles)" && source ~/.bashrc
sudo cp ~root/.ssh/authorized_keys ~/.ssh/ && \
sudo chown $USER:$USER ~/.ssh/authorized_keys && \
sudo sed -i.bak -r 's/#(PasswordAuthentication) yes/\1 no/' /etc/ssh/sshd_config && \
sudo reload ssh
Try to ssh
into the server in a new tab. If you can login without a password, your SSH public key is where it needs to be and the "root" user tab may be closed safely. If not, ensure that ~/.ssh/authorized_keys
exists and has the correct permissions!
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04