连接数据库
mysql -u root -p 
以普通账户mysql安全运行mysql,禁止mysql以管理员账号运行;
vim /etc/my.cnf 
在配置中进行设置[mysqld] 修改user=mysql #在文件最下面添加user=mysql
删除默认数据库
drop database test; 
改变默认mysql管理员为:SuperRoot;
updata user set user="SuperRoot" where user="root"; 
立即生效
flush privileges; 
使用mysql内置MD5加密函数加密用户user1的密码为(P@ssw0rd1!)。
update mysql.user set password=md5("P@ssw0rd1!") where user = 'user1'; 
Linux防火墙策略
linux系统使用iptables禁用23端口;
iptables -A INPUT -p tcp --dport 23 -j DROP 
linux系统使用iptables禁止别人ping通。
iptables -A INPUT -p icmp -j DROP 
linux系统为确保安全禁止所有人连接ssh除了192.168.1.1这个ip
iptables -A INPUT -p tcp --dport ssh -s 192.168.1.1 -j ACCEPT
iptables -A INPUT -p tcp --dport ssh -j DROP 
                


















