-
Notifications
You must be signed in to change notification settings - Fork 496
ubuntu setup
cowboy edited this page Oct 25, 2014
·
20 revisions
(tested with 14.04.1 LTS)
ssh root@aaa.bbb.ccc.ddd
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
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
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