VPS初始化checklist
仅供存档。另外,virmach黑五大减价了,KVM主机5.6$一年美滋滋。
这是我的邀请链接:https://billing.virmach.com/aff.php?aff=3032,优惠码是2017BFSAVE20
。
新建用户
adduser hh
gpasswd -a hh sudo
添加SSH-KEY验证并禁用root用户SSH远程登录
su - demo
mkdir .ssh
chmod 700 .ssh
vi .ssh/authorized_keys
#vi /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
Port 22222
sudo systemctl restart ssh
安装配置防火墙 (ufw)
sudo apt-get update&&sudo apt-get upgrade
sudo apt-get install ufw
sudo ufw allow 22222 #允许SSH
sudo ufw enable
安装vim (略)
安装shadowsocks-libev
sudo sh -c 'printf "deb http://httpredir.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list'
sudo apt update
sudo apt -t jessie-backports install shadowsocks-libev
sudo vim /etc/shadowsocks-libev/config.json
sudo ufw allow <PORT>
sudo systemctl start shadowsocks-libev
sudo systemctl enable shadowsocks-libev
安装4.x内核
sudo apt-get install -t jessie-backports linux-image-amd64
sudo update-grub