From: Christian Heller Date: Thu, 26 Sep 2024 22:27:39 +0000 (+0200) Subject: Various updates. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/foo.html?a=commitdiff_plain;h=fd775924eb94791f7efb1f44a7d4935823bf0ee2;p=config Various updates. --- diff --git a/bookworm/apt-mark/all b/bookworm/apt-mark/all index 617b707..aa1b30d 100644 --- a/bookworm/apt-mark/all +++ b/bookworm/apt-mark/all @@ -10,3 +10,7 @@ locales # extremely useful for basic network debugging; missed these more than once in an emergency 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/setup_scripts/_setup.sh b/bookworm/setup_scripts/_setup.sh index 1b8cae2..5f4bfda 100755 --- a/bookworm/setup_scripts/_setup.sh +++ b/bookworm/setup_scripts/_setup.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e . ./misc.sh -. ./../misc.sh +. ../../misc.sh expect_n_args 2 "(hostname, FQDN)" "$@" hostname="$1" diff --git a/bookworm/setup_scripts/init_user_and_keybased_login.sh b/bookworm/setup_scripts/init_user_and_keybased_login.sh index ad45834..ed24e87 100755 --- a/bookworm/setup_scripts/init_user_and_keybased_login.sh +++ b/bookworm/setup_scripts/init_user_and_keybased_login.sh @@ -20,8 +20,8 @@ server="$1" ssh-keygen -f "/home/plom/.ssh/known_hosts" -R "${server}" # This will be used to log-in as root from plom account. -echo 'First, enter the old root password; then enter new password three times.' -ssh root@"${server}" "passwd" +printf '\nFirst, enter the old root password; then enter new password three times.\n\n' +ssh root@"${server}" 'printf "\n\n" && passwd' # Save root password for sshpass stty -echo diff --git a/bookworm/setup_scripts/upgrade_from_bullseye.sh b/bookworm/setup_scripts/upgrade_from_bullseye.sh deleted file mode 100755 index ed246e1..0000000 --- a/bookworm/setup_scripts/upgrade_from_bullseye.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Upgrade a fresh (!) system to Bookworm, as per [1]. Fresh, because: Don't -# expect any customized config files to survive this. If you run this on a -# remote machine, take care not to loose anything you need to re-connect, e.g. -# any relevant adaptations you did to /etc/ssh/sshd_config … - -set -e -. ./misc.sh -apt update -apt -y 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" full-upgrade -apt -y autoremove diff --git a/bookworm/setup_scripts/upgrade_from_older_release.sh b/bookworm/setup_scripts/upgrade_from_older_release.sh new file mode 100755 index 0000000..ed246e1 --- /dev/null +++ b/bookworm/setup_scripts/upgrade_from_older_release.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Upgrade a fresh (!) system to Bookworm, as per [1]. Fresh, because: Don't +# expect any customized config files to survive this. If you run this on a +# remote machine, take care not to loose anything you need to re-connect, e.g. +# any relevant adaptations you did to /etc/ssh/sshd_config … + +set -e +. ./misc.sh +apt update +apt -y 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" full-upgrade +apt -y autoremove diff --git a/bullseye/setup_scripts/init_user_and_keybased_login.sh b/bullseye/setup_scripts/init_user_and_keybased_login.sh index 475b12f..b69a095 100755 --- a/bullseye/setup_scripts/init_user_and_keybased_login.sh +++ b/bullseye/setup_scripts/init_user_and_keybased_login.sh @@ -20,9 +20,8 @@ server="$1" ssh-keygen -f "/home/plom/.ssh/known_hosts" -R "${server}" # This will be used to log-in as root from plom account. -echo 'First, enter the old root password; then enter new password three times.' -#ssh root@"${server}" "passwd" -ssh root@"${server}" "ls" +printf '\nFirst, enter the old root password; then enter new password three times.\n\n' +ssh root@"${server}" 'printf "\n\n" && passwd' # Save root password for sshpass stty -echo @@ -41,6 +40,7 @@ export SSHPASS="${PW_ROOT}" # would require setting a password for user plom otherwise not needed. sshpass -e scp ~/.ssh/id_rsa.pub root@"${server}":/tmp/authorized_keys sshpass -e ssh root@"${server}" \ + 'useradd -m plom && '\ 'mkdir /home/plom/.ssh && '\ 'chown plom:plom /home/plom/.ssh && '\ 'chown plom:plom /tmp/authorized_keys && '\