From 13ac5e607fe3526bac7d7a76e7bdf1039ce2b40e Mon Sep 17 00:00:00 2001 From: tteckster Date: Mon, 19 Dec 2022 11:08:29 -0500 Subject: [PATCH] code refactoring (#845) --- setup/adguard-install.sh | 6 ++---- setup/blocky-install.sh | 6 ++---- setup/casaos-install.sh | 6 ++---- setup/changedetection-install.sh | 6 ++---- setup/daemonsync-install.sh | 6 ++---- setup/dashy-install.sh | 6 ++---- setup/debian-install.sh | 6 ++---- setup/deconz-install.sh | 6 ++---- setup/docker-install.sh | 6 ++---- setup/emby-install.sh | 6 ++---- setup/emqx-install.sh | 6 ++---- setup/esphome-install.sh | 6 ++---- setup/grafana-install.sh | 6 ++---- setup/grocy-install.sh | 6 ++---- setup/heimdalldashboard-install.sh | 6 ++---- setup/homeassistant-core-install.sh | 6 ++---- setup/homeassistant-install.sh | 6 ++---- setup/homebridge-install.sh | 6 ++---- setup/homepage-install.sh | 6 ++---- setup/influxdb-install.sh | 6 ++---- setup/iobroker-install.sh | 6 ++---- setup/jellyfin-install.sh | 6 ++---- setup/keycloak-install.sh | 6 ++---- setup/magicmirror-install.sh | 6 ++---- setup/mariadb-install.sh | 6 ++---- setup/meshcentral-install.sh | 6 ++---- setup/motioneye-install.sh | 6 ++---- setup/mqtt-install.sh | 6 ++---- setup/n8n-install.sh | 6 ++---- setup/navidrome-install.sh | 6 ++---- setup/nextcloudpi-install.sh | 6 ++---- setup/nginx-proxy-manager-install.sh | 6 ++---- setup/nocodb-install.sh | 6 ++---- setup/node-red-install.sh | 6 ++---- setup/omada-install.sh | 6 ++---- setup/omv-install.sh | 6 ++---- setup/openhab-install.sh | 6 ++---- setup/photoprism-install.sh | 6 ++---- setup/pihole-install.sh | 6 ++---- setup/plex-install.sh | 6 ++---- setup/podman-homeassistant-install.sh | 6 ++---- setup/postgresql-install.sh | 6 ++---- setup/prometheus-install.sh | 6 ++---- setup/scrypted-install.sh | 6 ++---- setup/shinobi-install.sh | 6 ++---- setup/syncthing-install.sh | 6 ++---- setup/technitiumdns-install.sh | 6 ++---- setup/trilium-install.sh | 6 ++---- setup/ubuntu-install.sh | 6 ++---- setup/umbrel-install.sh | 6 ++---- setup/unifi-install.sh | 6 ++---- setup/uptimekuma-install.sh | 6 ++---- setup/vaultwarden-install.sh | 6 ++---- setup/whoogle-install.sh | 6 ++---- setup/wikijs-install.sh | 6 ++---- setup/wireguard-install.sh | 6 ++---- setup/zigbee2mqtt-install.sh | 6 ++---- setup/zwave-js-ui-install.sh | 6 ++---- 58 files changed, 116 insertions(+), 232 deletions(-) diff --git a/setup/adguard-install.sh b/setup/adguard-install.sh index ec248d10d..bfaf8b83f 100644 --- a/setup/adguard-install.sh +++ b/setup/adguard-install.sh @@ -107,10 +107,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/blocky-install.sh b/setup/blocky-install.sh index 39690a378..620c57a23 100644 --- a/setup/blocky-install.sh +++ b/setup/blocky-install.sh @@ -363,10 +363,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/casaos-install.sh b/setup/casaos-install.sh index dbd626049..23ea0f98a 100644 --- a/setup/casaos-install.sh +++ b/setup/casaos-install.sh @@ -116,10 +116,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/changedetection-install.sh b/setup/changedetection-install.sh index 486c474b7..923ca216c 100644 --- a/setup/changedetection-install.sh +++ b/setup/changedetection-install.sh @@ -122,10 +122,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/daemonsync-install.sh b/setup/daemonsync-install.sh index ef0b5f9b0..e70c99436 100644 --- a/setup/daemonsync-install.sh +++ b/setup/daemonsync-install.sh @@ -109,10 +109,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/dashy-install.sh b/setup/dashy-install.sh index 7bd1c5a04..677b49138 100644 --- a/setup/dashy-install.sh +++ b/setup/dashy-install.sh @@ -140,10 +140,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/debian-install.sh b/setup/debian-install.sh index 96b5f9847..124a89846 100644 --- a/setup/debian-install.sh +++ b/setup/debian-install.sh @@ -101,10 +101,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/deconz-install.sh b/setup/deconz-install.sh index 476a61a93..7c5f1b080 100644 --- a/setup/deconz-install.sh +++ b/setup/deconz-install.sh @@ -133,10 +133,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/docker-install.sh b/setup/docker-install.sh index 6fc265d4c..b455fbbc5 100644 --- a/setup/docker-install.sh +++ b/setup/docker-install.sh @@ -159,10 +159,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/emby-install.sh b/setup/emby-install.sh index 1c0b0622f..979f19552 100644 --- a/setup/emby-install.sh +++ b/setup/emby-install.sh @@ -122,10 +122,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/emqx-install.sh b/setup/emqx-install.sh index da49201b5..e73f77770 100644 --- a/setup/emqx-install.sh +++ b/setup/emqx-install.sh @@ -107,10 +107,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/esphome-install.sh b/setup/esphome-install.sh index 15160dcec..91092358d 100644 --- a/setup/esphome-install.sh +++ b/setup/esphome-install.sh @@ -129,10 +129,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/grafana-install.sh b/setup/grafana-install.sh index 0570d690f..c912e4727 100644 --- a/setup/grafana-install.sh +++ b/setup/grafana-install.sh @@ -116,10 +116,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi systemctl start grafana-server systemctl enable grafana-server.service &>/dev/null diff --git a/setup/grocy-install.sh b/setup/grocy-install.sh index 20166eb04..8740d66fe 100644 --- a/setup/grocy-install.sh +++ b/setup/grocy-install.sh @@ -145,10 +145,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/heimdalldashboard-install.sh b/setup/heimdalldashboard-install.sh index 4f57ac507..ff8cc3864 100644 --- a/setup/heimdalldashboard-install.sh +++ b/setup/heimdalldashboard-install.sh @@ -140,10 +140,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/homeassistant-core-install.sh b/setup/homeassistant-core-install.sh index cde1bef34..d49b08f23 100644 --- a/setup/homeassistant-core-install.sh +++ b/setup/homeassistant-core-install.sh @@ -185,10 +185,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/homeassistant-install.sh b/setup/homeassistant-install.sh index 6e78f010a..11af74121 100644 --- a/setup/homeassistant-install.sh +++ b/setup/homeassistant-install.sh @@ -343,10 +343,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/homebridge-install.sh b/setup/homebridge-install.sh index f6ab776ca..8ce65cf0e 100644 --- a/setup/homebridge-install.sh +++ b/setup/homebridge-install.sh @@ -119,10 +119,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/homepage-install.sh b/setup/homepage-install.sh index 80c4ef201..0f60d5b14 100644 --- a/setup/homepage-install.sh +++ b/setup/homepage-install.sh @@ -137,10 +137,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/influxdb-install.sh b/setup/influxdb-install.sh index 7e8aab4cf..07c40091d 100644 --- a/setup/influxdb-install.sh +++ b/setup/influxdb-install.sh @@ -140,10 +140,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/iobroker-install.sh b/setup/iobroker-install.sh index 271401b64..5c2580db9 100644 --- a/setup/iobroker-install.sh +++ b/setup/iobroker-install.sh @@ -107,10 +107,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/jellyfin-install.sh b/setup/jellyfin-install.sh index b9e9de7ac..176dc5fc6 100644 --- a/setup/jellyfin-install.sh +++ b/setup/jellyfin-install.sh @@ -147,10 +147,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/keycloak-install.sh b/setup/keycloak-install.sh index b72f14fe6..6e412b6df 100644 --- a/setup/keycloak-install.sh +++ b/setup/keycloak-install.sh @@ -128,10 +128,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/magicmirror-install.sh b/setup/magicmirror-install.sh index a1ab2eecf..e252fea4b 100644 --- a/setup/magicmirror-install.sh +++ b/setup/magicmirror-install.sh @@ -224,10 +224,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/mariadb-install.sh b/setup/mariadb-install.sh index b4e261ced..6d0ad6083 100644 --- a/setup/mariadb-install.sh +++ b/setup/mariadb-install.sh @@ -124,10 +124,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/meshcentral-install.sh b/setup/meshcentral-install.sh index 1e5789be5..114424d5d 100644 --- a/setup/meshcentral-install.sh +++ b/setup/meshcentral-install.sh @@ -118,10 +118,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/motioneye-install.sh b/setup/motioneye-install.sh index f718adc4c..b75283353 100644 --- a/setup/motioneye-install.sh +++ b/setup/motioneye-install.sh @@ -137,10 +137,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/mqtt-install.sh b/setup/mqtt-install.sh index 180b0c455..b0d2406d2 100644 --- a/setup/mqtt-install.sh +++ b/setup/mqtt-install.sh @@ -114,10 +114,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/n8n-install.sh b/setup/n8n-install.sh index 70e4b6159..a6689a66b 100644 --- a/setup/n8n-install.sh +++ b/setup/n8n-install.sh @@ -130,10 +130,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/navidrome-install.sh b/setup/navidrome-install.sh index b6cc28e57..e08f08428 100644 --- a/setup/navidrome-install.sh +++ b/setup/navidrome-install.sh @@ -156,10 +156,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/nextcloudpi-install.sh b/setup/nextcloudpi-install.sh index 217eb7cfb..dba702f4a 100644 --- a/setup/nextcloudpi-install.sh +++ b/setup/nextcloudpi-install.sh @@ -105,10 +105,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/nginx-proxy-manager-install.sh b/setup/nginx-proxy-manager-install.sh index 9fc27d3de..f60e548d7 100644 --- a/setup/nginx-proxy-manager-install.sh +++ b/setup/nginx-proxy-manager-install.sh @@ -262,10 +262,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Starting Services" diff --git a/setup/nocodb-install.sh b/setup/nocodb-install.sh index be07ed72a..9244e6056 100644 --- a/setup/nocodb-install.sh +++ b/setup/nocodb-install.sh @@ -136,10 +136,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/node-red-install.sh b/setup/node-red-install.sh index 8e7257ec0..b535cf54d 100644 --- a/setup/node-red-install.sh +++ b/setup/node-red-install.sh @@ -138,10 +138,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/omada-install.sh b/setup/omada-install.sh index dc5a8dede..d55510f91 100644 --- a/setup/omada-install.sh +++ b/setup/omada-install.sh @@ -112,10 +112,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/omv-install.sh b/setup/omv-install.sh index f5bf32677..3b8b07e37 100644 --- a/setup/omv-install.sh +++ b/setup/omv-install.sh @@ -124,10 +124,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/openhab-install.sh b/setup/openhab-install.sh index 082db069a..24600d2d9 100644 --- a/setup/openhab-install.sh +++ b/setup/openhab-install.sh @@ -124,10 +124,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/photoprism-install.sh b/setup/photoprism-install.sh index 85349d256..a879cc0e8 100644 --- a/setup/photoprism-install.sh +++ b/setup/photoprism-install.sh @@ -197,10 +197,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/pihole-install.sh b/setup/pihole-install.sh index a43a230eb..1b785b05d 100644 --- a/setup/pihole-install.sh +++ b/setup/pihole-install.sh @@ -127,10 +127,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/plex-install.sh b/setup/plex-install.sh index fad4c0487..478838562 100644 --- a/setup/plex-install.sh +++ b/setup/plex-install.sh @@ -126,10 +126,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/podman-homeassistant-install.sh b/setup/podman-homeassistant-install.sh index c7e09cd74..9cd770874 100644 --- a/setup/podman-homeassistant-install.sh +++ b/setup/podman-homeassistant-install.sh @@ -160,10 +160,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/postgresql-install.sh b/setup/postgresql-install.sh index 8587b17c1..4b5986be4 100644 --- a/setup/postgresql-install.sh +++ b/setup/postgresql-install.sh @@ -231,10 +231,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/prometheus-install.sh b/setup/prometheus-install.sh index 8b3f79071..8c0b5dc84 100644 --- a/setup/prometheus-install.sh +++ b/setup/prometheus-install.sh @@ -136,10 +136,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/scrypted-install.sh b/setup/scrypted-install.sh index b9b9223f7..1bb80bdc3 100644 --- a/setup/scrypted-install.sh +++ b/setup/scrypted-install.sh @@ -195,10 +195,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/shinobi-install.sh b/setup/shinobi-install.sh index 6eeb65cc3..a72a55724 100644 --- a/setup/shinobi-install.sh +++ b/setup/shinobi-install.sh @@ -165,10 +165,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/syncthing-install.sh b/setup/syncthing-install.sh index cb3b21136..15e34ca23 100644 --- a/setup/syncthing-install.sh +++ b/setup/syncthing-install.sh @@ -110,10 +110,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/technitiumdns-install.sh b/setup/technitiumdns-install.sh index ab51a406f..509e2fda7 100644 --- a/setup/technitiumdns-install.sh +++ b/setup/technitiumdns-install.sh @@ -107,10 +107,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/trilium-install.sh b/setup/trilium-install.sh index f62528e79..f5080744f 100644 --- a/setup/trilium-install.sh +++ b/setup/trilium-install.sh @@ -131,10 +131,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/ubuntu-install.sh b/setup/ubuntu-install.sh index 9b7597ba0..3cc2a4b33 100644 --- a/setup/ubuntu-install.sh +++ b/setup/ubuntu-install.sh @@ -102,10 +102,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/umbrel-install.sh b/setup/umbrel-install.sh index e233a6a70..11f26a6d8 100644 --- a/setup/umbrel-install.sh +++ b/setup/umbrel-install.sh @@ -117,10 +117,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" apt-get autoremove >/dev/null diff --git a/setup/unifi-install.sh b/setup/unifi-install.sh index 0a7f87e33..2210a47e7 100644 --- a/setup/unifi-install.sh +++ b/setup/unifi-install.sh @@ -115,10 +115,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/uptimekuma-install.sh b/setup/uptimekuma-install.sh index a7305c9e0..f08f50216 100644 --- a/setup/uptimekuma-install.sh +++ b/setup/uptimekuma-install.sh @@ -136,10 +136,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/vaultwarden-install.sh b/setup/vaultwarden-install.sh index bcd58970d..2047f631a 100644 --- a/setup/vaultwarden-install.sh +++ b/setup/vaultwarden-install.sh @@ -192,10 +192,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/whoogle-install.sh b/setup/whoogle-install.sh index 964b437c7..b574667a2 100644 --- a/setup/whoogle-install.sh +++ b/setup/whoogle-install.sh @@ -124,10 +124,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/wikijs-install.sh b/setup/wikijs-install.sh index 01d3df47d..512552118 100644 --- a/setup/wikijs-install.sh +++ b/setup/wikijs-install.sh @@ -152,10 +152,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/wireguard-install.sh b/setup/wireguard-install.sh index 6d7264176..e8b827533 100644 --- a/setup/wireguard-install.sh +++ b/setup/wireguard-install.sh @@ -166,10 +166,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/zigbee2mqtt-install.sh b/setup/zigbee2mqtt-install.sh index 910dffb44..2ac580b79 100644 --- a/setup/zigbee2mqtt-install.sh +++ b/setup/zigbee2mqtt-install.sh @@ -152,10 +152,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up" diff --git a/setup/zwave-js-ui-install.sh b/setup/zwave-js-ui-install.sh index 68ab18856..031ef3296 100644 --- a/setup/zwave-js-ui-install.sh +++ b/setup/zwave-js-ui-install.sh @@ -128,10 +128,8 @@ EOF msg_ok "Customized Container" fi if [[ "${SSH_ROOT}" == "yes" ]]; then - cat <>/etc/ssh/sshd_config -PermitRootLogin yes -EOF -systemctl restart sshd + sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config + systemctl restart sshd fi msg_info "Cleaning up"