Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed Feb 22, 2024
1 parent d3fe57a commit 0fd9ae3
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 142 deletions.
26 changes: 15 additions & 11 deletions images_yaml/almalinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -495,31 +495,35 @@ actions:
systemctl enable sshd || true
systemctl enable ssh || true
# sshd_config
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /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 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config || true
# cloud-init
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
# other config
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux || true
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config || 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
11 changes: 6 additions & 5 deletions images_yaml/alpine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,13 @@ actions:
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 @@ -455,9 +456,9 @@ actions:
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
26 changes: 15 additions & 11 deletions images_yaml/archlinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -843,31 +843,35 @@ actions:
systemctl enable sshd || true
systemctl enable ssh || true
# sshd_config
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /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 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config || true
# cloud-init
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
# other config
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux || true
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config || 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
26 changes: 15 additions & 11 deletions images_yaml/centos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -969,31 +969,35 @@ actions:
systemctl enable sshd || true
systemctl enable ssh || true
# sshd_config
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /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 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config || true
# cloud-init
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
# other config
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux || true
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config || 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
26 changes: 15 additions & 11 deletions images_yaml/debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1540,31 +1540,35 @@ actions:
systemctl enable sshd || true
systemctl enable ssh || true
# sshd_config
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /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 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config || true
# cloud-init
sed -i \"s/^#\\?Port.*/Port 22/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i "s/^#\?\(Port\).*/\1 22/" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i -E 's/^#?(Port).*/\1 22/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/#AddressFamily any/AddressFamily any/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/g\" /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^#UsePAM\\|UsePAM/c #UsePAM no' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
sed -i '/^AuthorizedKeysFile/s/^/#/' /etc/ssh/sshd_config.d/50-cloud-init.conf || true
# other config
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/sysconfig/selinux || true
sed -i.bak '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config || 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
Loading

0 comments on commit 0fd9ae3

Please sign in to comment.