sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
apt-get update
apt -y purge ufw lxd lxd-client lxcfs liblxc-common
apt -y install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev gcc openssh-server iotop unzip zip
apt install -y libsnmp30 libsodium23 libssh2-1 libtiff5 libwebp6 libxpm4 php-bcmath php-common php-gd php-ldap php-mbstring php-mysql php-xml php7.2-bcmath php7.2-cli php7.2-common php7.2-gd php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml snmpd ssl-cert ttf-dejavu-core libmysqlclient-dev libxml2-dev libxml2 snmp libsnmp-dev libevent-dev openjdk-8-jdk curl libcurl4-openssl-dev
sed -i "/#PermitRootLogin prohibit-password/a PermitRootLogin yes" /etc/ssh/sshd_config
sed -i "/#PasswordAuthentication yes/a PasswordAuthentication yes" /etc/ssh/sshd_config
sed -i '/#UseDNS no/a UseDNS no' /etc/ssh/sshd_config
sed -i '/#GSSAPIAuthentication no/a GSSAPIAuthentication no' /etc/ssh/sshd_config
systemctl restart sshd
# 以后再追加
标签:初始化,php,php7.2,dev,etc,sed,apt,Ubuntu18.04 From: https://www.cnblogs.com/zjl-123/p/17245611.html