Last active
August 29, 2015 14:28
-
-
Save wknowles/909415f0e07f8e722810 to your computer and use it in GitHub Desktop.
My First Steps on VPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
#FIRST STEPS ON A VPS (A PERSONAL SETUP) | |
## | |
#Log in | |
ssh root@"serverip" -p "ssh port" | |
#Update all packages | |
apt-get update; apt-get upgrade | |
#get nano | |
apt-get install nano | |
#fix locales | |
dpkg-reconfigure locales | |
#install sudo | |
apt-get install sudo | |
#add user | |
adduser "user" | |
#make user sudo | |
visudo | |
# User privilege specification | |
# add line below root to read: | |
# user ALL=(ALL:ALL) ALL | |
## | |
#If Feel like FISH | |
## | |
#download fish release key | |
wget http://download.opensuse.org/repositories/shells:fish:release:2/Debian_7.0/Release.key | |
#add fish release key | |
apt-key add - < Release.key | |
#change shell to fish | |
chsh -s /usr/bin/fish | |
#reload shell | |
#set nano as default text editor | |
set -Ux EDITOR nano | |
## | |
#END | |
## | |
#setup ssh keys | |
# nb the && that one would expect in bash ect... is replaced with ; in fish - swap out otherwise | |
cat ~/.ssh/id_rsa.pub | ssh "user"@"ip of remote server" -p "port of remote server" "mkdir -p ~/.ssh ; cat >> ~/.ssh/authorized_keys" | |
#disable root login | |
sudo nano /etc/ssh/sshd_config | |
#change PermitRootLogin to without-password | |
PermitRootLogin without-password | |
## | |
# Nyr openvpn script - must be run as root | |
## | |
wget git.io/vpn --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment