home · contact · privacy
Various updates.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 26 Sep 2024 22:27:39 +0000 (00:27 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 26 Sep 2024 22:27:39 +0000 (00:27 +0200)
bookworm/apt-mark/all
bookworm/setup_scripts/_setup.sh
bookworm/setup_scripts/init_user_and_keybased_login.sh
bookworm/setup_scripts/upgrade_from_bullseye.sh [deleted file]
bookworm/setup_scripts/upgrade_from_older_release.sh [new file with mode: 0755]
bullseye/setup_scripts/init_user_and_keybased_login.sh

index 617b7071caaa15fc79f4baa13a74cb55034ea9f0..aa1b30d4683d4463d6d9d88226bb85628597c6fd 100644 (file)
@@ -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
index 1b8cae253c36ef9a660c4c0538256199b3a8a5c8..5f4bfdacc77b42a5c6171ba3510820bc3df5d966 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -e
 . ./misc.sh
-. ./../misc.sh
+. ../../misc.sh
 
 expect_n_args 2 "(hostname, FQDN)" "$@"
 hostname="$1"
index ad458348f22ef453747af5028422da0313628d00..ed24e8757eadf4f6923dd5884602fb2db9d6507d 100755 (executable)
@@ -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 (executable)
index ed246e1..0000000
+++ /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 (executable)
index 0000000..ed246e1
--- /dev/null
@@ -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
index 475b12f76363612cb54227cf4a41ece212ded322..b69a0955c99ae99107d17742671ee82eb881926a 100755 (executable)
@@ -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 && '\