[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] share/debian-edu-config/tools/copy-host-keytab: Support SSH publickey login to...
Mike Gabriel (@sunweaver)
gitlab at salsa.debian.org
Thu May 7 21:28:42 BST 2026
Mike Gabriel pushed to branch master at Debian Edu / debian-edu-config
Commits:
c53528cf by Mike Gabriel at 2026-05-07T22:28:30+02:00
share/debian-edu-config/tools/copy-host-keytab: Support SSH publickey login to tjener, if this is possible (e.g. if admin is using SSH agent forwarding).
- - - - -
1 changed file:
- share/debian-edu-config/tools/copy-host-keytab
Changes:
=====================================
share/debian-edu-config/tools/copy-host-keytab
=====================================
@@ -1,6 +1,21 @@
#!/bin/sh
set -e
-kinit
+
+if [ $(id -u) -gt 0 ]; then
+ echo "ERROR: This script has to run as super-user root."
+ exit 1
+fi
+
+# Attempt passwordless SSH login root at tjener (could be publickey, gssapi-keyex, or gssapi-with-mic)
+set +e
+ssh -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no tjener "echo -n" 2>/dev/null
+ret=$?
+set -e
+if [ "${ret}" != "0" ]; then
+ # Try to get a Kerberos ticket for root instead to use GSSAPI login.
+ kinit root
+fi
+
scp tjener:/var/lib/debian-edu/host-keytabs/$(hostname -s).intern.keytab /etc/krb5.keytab
# Special case separate LTSP server.
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/c53528cfefa3500f9c22170b138334d956afd837
--
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/c53528cfefa3500f9c22170b138334d956afd837
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20260507/9ff2f2fb/attachment-0001.htm>
More information about the debian-edu-commits
mailing list