henryliangt / wordpress-managment

0 stars 0 forks source link

new machine #3

Open henryliangt opened 3 years ago

henryliangt commented 3 years ago

Install BT

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

henryliangt commented 3 years ago

安装PY3 两步 YUM 安装:

yum update -y yum install -y python3

测试: python3

手动安装: yum install gcc openssl-devel bzip2-devel libffi-devel -y curl -O https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz

tar -xzf Python-3.8.1.tgz cd Python-3.8.1/ ./configure --enable-optimizations make altinstall python3.8

henryliangt commented 3 years ago

login key-pair

ssh-keygen && cd .ssh && cat id_rsa.pub >> authorized_keys && chmod 600 authorized_keys && chmod 700 ~/.ssh && echo 'RSAAuthentication yes' >> /etc/ssh/sshd_config && echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config && service sshd restart && vim .ssh/id_rsa.pub

ssh-keygen

cd .ssh cat id_rsa.pub >> authorized_keys

chmod 600 authorized_keys chmod 700 ~/.ssh

vim /etc/ssh/sshd_config RSAAuthentication yes PubkeyAuthentication yes

PermitRootLogin yes

PasswordAuthentication no

service sshd restart

id_rsa copy to local machine

henryliangt commented 3 years ago

fail2ban

sudo yum -y install epel-release && sudo yum install fail2ban && sudo systemctl enable fail2ban

echo '123.123.123.123' >> /etc/fail2ban/jail.local cat /etc/fail2ban/jail.local sudo vim /etc/fail2ban/jail.local ''' [DEFAULT]

Ban hosts for one hour:

bantime = 3600

Override /etc/fail2ban/jail.d/00-firewalld.conf:

banaction = iptables-multiport

[sshd] enabled = true '''

sudo systemctl restart fail2ban sudo fail2ban-client status

sudo fail2ban-client status sshd

sudo nano /etc/fail2ban/jail.conf

ls /etc/fail2ban/filter.d

sudo journalctl -b -u fail2ban

sudo tail -F /var/log/fail2ban.log sudo tail -F /var/log/fail2ban.log sudo iptables -S