20210907:
镜像使用:
ubuntu-21.04-desktop-amd64.iso
默认root用户未开启、不登录
sudo su
sudo passwd root
apt-get install vim
sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
增加:
greeter-show-manual-login=true #手工输入登陆系统的用户名和密码
allow-guest=false #不允许guest登录(可选)
reboot
apt-get install openssh-server
apt-get upgrade
防火墙:
ufw disable //关闭防火墙
ufw status
ufw enable //开启防火墙
ufw default deny //拒接所有外来访问,本机能正常访问外部
ufw allow 80 //开放21端口
ufw reload //重启
ufw delete allow 22 //删除普通端口
ufw allow 8001/tcp //指定开放8001的tcp协议
ufw delete allow 8001/tcp
ufw allow from 192.168.121.1 // 指定ip为192.168.121.1的计算机操作所有端口
ufw delete allow from 192.168.121.1
ufw allow from 192.168.121.2 to any port 3306 // 开放指定ip为192.168.121.2的计算机访问本机的3306端口
ufw delete allow from 192.168.121.2 to any port 3306
nginx:
apt install nginx fcgiwrap nginx-doc
nginx -v
vim /etc/nginx/nginx.conf
service nginx start
service nginx status
apache2(httpd):
apt install apache2
service apache2 status
service apache2 start
vim /etc/apache2/apache2.conf
PHP:
apt install php
apt install php-fpm
service php-fpm status //安装时要注意看版本号
service php-fpm start
MySQL:
apt install mysql-server
service mysql status
mysql_secure_installation
mysql -uroot -p
select host,user,authentication_string,plugin from user;
update user set host='%' where user='root';
alter user 'root'@'%' identified by '123456' password expire never;
alter user 'root'@'%' identified with mysql_native_password by '123456';
flush privileges;