Ubuntu 新装服务器部署流程

1、设定时区

rm -f /etc/localtime
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2、配置apt-get源

sed -i 's/us.archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
sed -i 's/security.ubuntu/mirrors.aliyun.com/g' /etc/apt/sources.list

或者修改/etc/apt/sources.listUbuntu 14.04的最终如下:

deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

Ubuntu 16.04版本的最终效果如下:

deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

Ubuntu 18.04版本的最终效果如下:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

3、修改主机名

vim /etc/hostname

4、安装软件包

apt-get install lrzsz ntpdate

5、开启root登录

Ubuntu 14.04

sed -i 's/without-password/yes/g' /etc/ssh/sshd_config

Ubuntu 16.04

sed -i 's/prohibit-password/yes/g' /etc/ssh/sshd_config

重启服务

service ssh restart

6、踢出终端tty用户

pkill -kill -t tty

7、删除普通用户

8、时间同步

echo "$((RANDOM%60)) $((RANDOM%24)) * * * /usr/sbin/ntpdate time1.aliyun.com" >> /etc/crontab

9、安装监控系统

apt-get install zabbix-agent

10、配置pip国内源

mkdir .pip
cat >> .pip/pip.conf <

附:配置IP

修改文件/etc/network/interfaces

auto eth0
iface eth0 inet static
address  10.0.0.100
netmask  255.0.0.0
gateway  10.0.0.1
dns-nameservers 114.114.114.114
ssserver -p 443 -k wzlinux --log-file /tmp/ss.log --worker 2 -d start
python server.py -p 443 -k password -m aes-256-cfb -O auth_sha1_v4 -o http_simple
#说明:-p 端口 -k 密码  -m 加密方式 -O 协议插件 -o 混淆插件

转载于:https://blog.51cto.com/wzlinux/2043586

你可能感兴趣的:(Ubuntu 新装服务器部署流程)