From 6284595116e39a3bf5e90b62ed52365de70b312f Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Fri, 27 Sep 2024 00:55:46 +0200 Subject: [PATCH] Various fixes. --- bookworm/apt-mark/all | 2 -- bookworm/apt-mark/server | 2 ++ bookworm/setup_scripts/init_user_and_keybased_login.sh | 2 +- bookworm/setup_scripts/init_user_login.sh | 6 +++--- bookworm/setup_scripts/upgrade_from_older_release.sh | 9 ++++++--- bullseye/setup_scripts/init_user_and_keybased_login.sh | 4 ++-- misc.sh | 4 ++-- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/bookworm/apt-mark/all b/bookworm/apt-mark/all index aa1b30d..abd02d6 100644 --- a/bookworm/apt-mark/all +++ b/bookworm/apt-mark/all @@ -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 diff --git a/bookworm/apt-mark/server b/bookworm/apt-mark/server index 2ab22d2..6003591 100644 --- a/bookworm/apt-mark/server +++ b/bookworm/apt-mark/server @@ -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 diff --git a/bookworm/setup_scripts/init_user_and_keybased_login.sh b/bookworm/setup_scripts/init_user_and_keybased_login.sh index ed24e87..f2d83ee 100755 --- a/bookworm/setup_scripts/init_user_and_keybased_login.sh +++ b/bookworm/setup_scripts/init_user_and_keybased_login.sh @@ -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 diff --git a/bookworm/setup_scripts/init_user_login.sh b/bookworm/setup_scripts/init_user_login.sh index a36a5bd..f9733ff 100755 --- a/bookworm/setup_scripts/init_user_login.sh +++ b/bookworm/setup_scripts/init_user_login.sh @@ -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' diff --git a/bookworm/setup_scripts/upgrade_from_older_release.sh b/bookworm/setup_scripts/upgrade_from_older_release.sh index ed246e1..5175547 100755 --- a/bookworm/setup_scripts/upgrade_from_older_release.sh +++ b/bookworm/setup_scripts/upgrade_from_older_release.sh @@ -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}" diff --git a/bullseye/setup_scripts/init_user_and_keybased_login.sh b/bullseye/setup_scripts/init_user_and_keybased_login.sh index b69a095..544f3c6 100755 --- a/bullseye/setup_scripts/init_user_and_keybased_login.sh +++ b/bullseye/setup_scripts/init_user_and_keybased_login.sh @@ -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 adf8e1b..61ad026 100644 --- 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" -- 2.30.2