Change MySQL Password via SSH
Jun0
login ssh, type mysqladmin. A tip if you can not remember mysql password type
mysql -uadmin -p`cat /etc/psa/.psa.shadow`
mysql> USE mysql;
mysql> SELECT * FROM user;
mysql> SET PASSWORD FOR 'username'@'hostname' = PASSWORD('password_here');
mysql> FLUSH PRIVILEGES;
Open and Close Port in Linux
May1
For more secure server, we have to close some ports to users. If need access to this ports, we can give permission to our IP address. We need static IP address for this operation. Please dont forget, “iptables” can be block all IP address but when you restart the server it will be clean all of this commands. (I am using Fedora)
Closing FTP port except xxx.xxx.xxx.xxx
iptables -t filter -I INPUT 1 -p tcp -s ! xxx.xxx.xxx.xxx –dport 21 -j REJECT –reject-with icmp-host-prohibited
Closing SSH port except xxx.xxx.xxx.xxx
iptables -t filter -I INPUT 1 -p tcp -s ! xxx.xxx.xxx.xxx –dport ssh -j REJECT –reject-with icmp-host-prohibited
Closing MySQL port except localhost
iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp –destination-port 3306 -j ACCEPT
Listing iptables list
iptables -L
Removing iptables data (Removing first one in list, type 2 for second one)
iptables -D INPUT 1

