centos7 基本实际操作

2021-03-26 09:05 jianzhan
echo |sudo chpasswd root sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo service sshd restart 1.加上swap dd if=/dev/zero of=/mnt/swapfile bs=1024 count=1048576 chmod 0600 /mnt/swapfile mkswap /mnt/swapfile swapon /mnt/swapfile vi /etc/fstab /mnt/swapfile swap swap defaults 0 0 vi /etc/sysctl.conf vm.swappiness=10 2.提升起动项 systemctl list-unit-files | grep enable systemctl stop irqbalance.service #虚似行政机关闭 systemctl stop kdump.service systemctl stop firewalld.service systemctl disable irqbalance.service systemctl disable kdump.service systemctl disable firewalld.service 3.升级系统软件 yum makecache yum upgrade 4.改动登陆密码端口号及登录IP passwd vi /etc/ssh/sshd_config service sshd restart vi /etc/hosts.allow sshd:xx.xx.0.0/16:allow vi /etc/hosts.deny sshd:ALL
# Firewall configuration written by system-config-firewall # Manual customization of this file is mended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -i lo -j ACCEPT #-A INPUT -p icmp -j ACCEPT #-A INPUT -p icmp --icmp-type 8 -s 0/0 -j DROP -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT 打开systemctl restart iptables.service 自启systemctl enable iptables.services 6.reboot 脚本制作 发觉Out of Stock表明断货中,可考虑到选购其他VPS。自备Google访问器有简易的汉语翻译作用。
买老外的网站域名、vps都需美金。有个人信用卡可立即选购。无卡无美金的申请注册Paypal到淘宝网请人充美金就可以。老外VPS选购实例教程参照:index.php/archives/259/
Google: Here are a few of the web sites mend for o...
张小三資源网: 忘掉把SELINUX改动为permissive了,前文已加上。 无需脚本制作得话,手动式还可以不删核心,查...