home · contact · privacy
Various fixes.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 26 Sep 2024 22:55:46 +0000 (00:55 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 26 Sep 2024 22:55:46 +0000 (00:55 +0200)
bookworm/apt-mark/all
bookworm/apt-mark/server
bookworm/setup_scripts/init_user_and_keybased_login.sh
bookworm/setup_scripts/init_user_login.sh
bookworm/setup_scripts/upgrade_from_older_release.sh
bullseye/setup_scripts/init_user_and_keybased_login.sh
misc.sh

index aa1b30d4683d4463d6d9d88226bb85628597c6fd..abd02d667da5c4ab3362be1abd2928549bf65bba 100644 (file)
@@ -12,5 +12,3 @@ netcat-traditional
 iputils-ping
 # what would we do without this …
 apt
-# not only pull in systemd, but also /sbin/reboot and /sbin/shutdown
-systemd-sysv
index 2ab22d269b0ca738aff23f81b34724f365ad9dd7..60035912347a7b64a920e539edeed6543c1fa2b3 100644 (file)
@@ -4,3 +4,5 @@ openssh-server
 nftables
 # We want to be able to use ALL our servers as borg backup destinations.
 borgbackup
+# not only pull in systemd, but also /sbin/reboot and /sbin/shutdown
+systemd-sysv
index ed24e8757eadf4f6923dd5884602fb2db9d6507d..f2d83ee6a2d97cde6ceffb83fd741b93a2b83698 100755 (executable)
@@ -8,7 +8,7 @@
 # /etc/ssh/sshd_config.
 #
 # Dependencies: ssh, scp, sshpass, ~/.ssh/id_rsa.pub, properly
-# configured sshd_config file in misc.sh:$linkable_files_dir
+# configured sshd_config file in misc.sh:$local_etc_server
 set -e
 . ./misc.sh
 . ../../misc.sh
index a36a5bdbb823a7bc80d0e80691dfff2b19984c98..f9733ff33f06e890762b77aafb064aa628cc61ec 100755 (executable)
@@ -8,7 +8,7 @@
 # /etc/ssh/sshd_config.
 #
 # Dependencies: ssh, scp, ~/.ssh/id_rsa.pub, properly configured sshd_config
-# file in misc.sh:$linkable_files_dir
+# file in misc.sh:local_etc_server$
 set -e
 . ./misc.sh
 . ../../misc.sh
@@ -24,8 +24,8 @@ eval $(ssh-agent)
 ssh-add
 
 # This will be used to log-in as root from plom account.
-echo 'Asking for new root password.'
-ssh root@"${server}" "passwd"
+printf '\nAsking for new root password.\n\n'
+ssh root@"${server}" 'printf "\n\n" && passwd'
 
 # Set up plom's ~/.ssh/authorized_keys from root's.
 ssh root@"${server}" 'useradd -m plom'
index ed246e1e6a2ec0b2477078448df13c2f550842f1..5175547d1a47c096acf20c70cbfc489b527ab502 100755 (executable)
@@ -7,13 +7,16 @@
 
 set -e
 . ./misc.sh
+
+path_sources_list="/etc/apt/sources.list"
+
 apt update
-apt -y upgrade
+apt -y -o Dpkg::Options::="--force-confnew" upgrade
 apt -y -o Dpkg::Options::="--force-confnew" full-upgrade
-path_sources_list="/etc/apt/sources.list"
 cp "${config_tree_prefix}/etc_files/all${path_sources_list}" "${path_sources_list}"
 apt clean
 apt update
-apt -y upgrade
+apt -y -o Dpkg::Options::="--force-confnew" upgrade
 apt -y -o Dpkg::Options::="--force-confnew" full-upgrade
 apt -y autoremove
+cp "${locall_path_sshd_config}" "${system_path_sshd_config}"
index b69a0955c99ae99107d17742671ee82eb881926a..544f3c60bdf70ebe5cd38fbc772a41cbb3f1af15 100755 (executable)
@@ -8,7 +8,7 @@
 # /etc/ssh/sshd_config.
 #
 # Dependencies: ssh, scp, sshpass, ~/.ssh/id_rsa.pub, properly
-# configured sshd_config file in misc.sh:$linkable_files_dir
+# configured sshd_config file in misc.sh:$local_etc_server
 set -e
 . ./misc.sh
 . ../../misc.sh
@@ -21,7 +21,7 @@ ssh-keygen -f "/home/plom/.ssh/known_hosts" -R "${server}"
 
 # This will be used to log-in as root from plom account.
 printf '\nFirst, enter the old root password; then enter new password three times.\n\n'
-ssh root@"${server}" 'printf "\n\n" && passwd'
+ssh root@"${server}" 'printf "\n" && passwd'
 
 # Save root password for sshpass
 stty -echo
diff --git a/misc.sh b/misc.sh
index adf8e1baed8b7bfae7e537c35cfaa21566106a6f..61ad026c9cac891f1fbb940361b7a03691806955 100644 (file)
--- a/misc.sh
+++ b/misc.sh
@@ -1,8 +1,8 @@
 #!/bin/sh
 
-linkable_files_dir="${config_tree_prefix}/etc_files/server"
+local_etc_server="${config_tree_prefix}/etc_files/server"
 system_path_sshd_config='/etc/ssh/sshd_config'
-local_path_sshd_config="${linkable_files_dir}${system_path_sshd_config}"
+local_path_sshd_config="${local_etc_server}${system_path_sshd_config}"
 
 expect_n_args() {
     min_args="$1"