一只会飞的旺旺
文章152
标签131
分类7
服务器常用脚本

服务器常用脚本

小卖铺上新啦!ChatGPT账号大甩卖! 一键直达

快速初始化root用户

sudo -i
vi /root/.ssh/authorized_keys
# 把ssh-rsa之前的内容都删除掉.
#!/bin/bash
echo root:123456 |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

关闭防火墙

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F

服务器端超时设置

bash -c "echo 'TCPKeepAlive yes' >> /etc/ssh/sshd_config && echo 'ClientAliveInterval 60' >> /etc/ssh/sshd_config"
systemctl restart sshd
微信支付码 微信支付
支付宝支付码 支付宝支付