Skip to content

Commit

Permalink
Update sh_insert_content.text
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS authored Feb 22, 2024
1 parent 8a2e0e7 commit d3fe57a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sh_insert_content.text
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

cd /etc/ssh || true
ssh-keygen -A || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config || true
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config || true
sed -i '/^#PermitRootLogin\|PermitRootLogin/c PermitRootLogin yes' /etc/ssh/sshd_config || true
sed -i "s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config || true
sed -i '/^#ListenAddress\|ListenAddress/c ListenAddress 0.0.0.0' /etc/ssh/sshd_config || true
sed -i '/^#AddressFamily\|AddressFamily/c AddressFamily any' /etc/ssh/sshd_config || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config || true
sed -i '/^#UsePAM\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config || true
sed -E -i 's/preserve_hostname:[[:space:]]*false/preserve_hostname: true/g' /etc/cloud/cloud.cfg || true
sed -E -i 's/disable_root:[[:space:]]*true/disable_root: false/g' /etc/cloud/cloud.cfg || true
Expand All @@ -20,9 +21,9 @@
rc-update add sshd default || true
/etc/init.d/cron enable || true
/etc/init.d/cron start || true
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config || true
echo "Related repo https://github.com/oneclickvirt/incus\n--by https://t.me/spiritlhl" >> /etc/motd || true
echo "Related repo https://github.com/oneclickvirt/incus\n--by https://t.me/spiritlhl" >> /etc/banner || true
grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config || echo "PermitRootLogin yes" >> /etc/ssh/sshd_config || true
echo "Related repo https://github.com/oneclickvirt/lxc_amd64_images\n--by https://t.me/spiritlhl" >> /etc/motd || true
echo "Related repo https://github.com/oneclickvirt/lxc_amd64_images\n--by https://t.me/spiritlhl" >> /etc/banner || true

types:
- container
Expand Down

0 comments on commit d3fe57a

Please sign in to comment.