mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-03 09:13:29 +08:00
update
This commit is contained in:
parent
3674b642c8
commit
cde49e40d5
1 changed files with 3 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# from
|
# from
|
||||||
# https://github.com/spiritLHLS/pve
|
# https://github.com/spiritLHLS/pve
|
||||||
# 2023.07.31
|
# 2023.08.04
|
||||||
|
|
||||||
if [ -f "/etc/resolv.conf" ]
|
if [ -f "/etc/resolv.conf" ]
|
||||||
then
|
then
|
||||||
|
@ -146,7 +146,6 @@ if [ -f "/etc/motd" ]; then
|
||||||
echo 'Related repo https://github.com/spiritLHLS/pve' >> /etc/motd
|
echo 'Related repo https://github.com/spiritLHLS/pve' >> /etc/motd
|
||||||
echo '--by https://t.me/spiritlhl' >> /etc/motd
|
echo '--by https://t.me/spiritlhl' >> /etc/motd
|
||||||
fi
|
fi
|
||||||
sshport=22
|
|
||||||
service iptables stop 2> /dev/null ; chkconfig iptables off 2> /dev/null ;
|
service iptables stop 2> /dev/null ; chkconfig iptables off 2> /dev/null ;
|
||||||
if [ -f "/etc/sysconfig/selinux" ]; then
|
if [ -f "/etc/sysconfig/selinux" ]; then
|
||||||
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux
|
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux
|
||||||
|
@ -156,7 +155,7 @@ if [ -f "/etc/selinux/config" ]; then
|
||||||
fi
|
fi
|
||||||
setenforce 0;
|
setenforce 0;
|
||||||
if [ -f /etc/ssh/sshd_config ]; then
|
if [ -f /etc/ssh/sshd_config ]; then
|
||||||
sed -i 's/^#\?Port.*/Port $sshport/g' /etc/ssh/sshd_config
|
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||||
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config
|
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config
|
||||||
|
@ -167,7 +166,7 @@ if [ -f /etc/ssh/sshd_config ]; then
|
||||||
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config
|
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config
|
||||||
fi
|
fi
|
||||||
if [ -f /etc/ssh/sshd_config.d/50-cloud-init.conf ]; then
|
if [ -f /etc/ssh/sshd_config.d/50-cloud-init.conf ]; then
|
||||||
sed -i "s/^#\?Port.*/Port $sshport/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
sed -i "s/^#\?Port.*/Port 22/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
||||||
sed -i "s/^#\?PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
sed -i "s/^#\?PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
||||||
sed -i "s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
sed -i "s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config.d/50-cloud-init.conf
|
||||||
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf
|
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf
|
||||||
|
|
Loading…
Reference in a new issue