Create a 'kerberos' folder and add my krbroot script.
authorNelson Elhage <nelhage@mit.edu>
Wed, 25 Feb 2009 17:09:10 +0000 (12:09 -0500)
committerNelson Elhage <nelhage@mit.edu>
Wed, 25 Feb 2009 17:09:10 +0000 (12:09 -0500)
kerberos/kdo/README [moved from kdo/README with 100% similarity]
kerberos/kdo/bashrc [moved from kdo/bashrc with 100% similarity]
kerberos/krbroot [new file with mode: 0755]

similarity index 100%
rename from kdo/README
rename to kerberos/kdo/README
similarity index 100%
rename from kdo/bashrc
rename to kerberos/kdo/bashrc
diff --git a/kerberos/krbroot b/kerberos/krbroot
new file mode 100755 (executable)
index 0000000..b831003
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+export KRB5CCNAME=/tmp/krb5cc_$(id -u).root
+export KRBTKFILE=/tmp/tkt$(id -u).root
+
+case $1 in
+    init)
+        shift;
+        exec kinit -F -5 -l15m $USER/root@ATHENA.MIT.EDU "$@"
+        ;;
+    destroy)
+        exec kdestroy -45
+        ;;
+    shell)
+        klist -s || krbroot init || exit 1;
+        HOST="`hostname` (krbroot)" pagsh -c $SHELL
+        ;;
+    ssh)
+        klist -s || krbroot init || exit 1;
+        shift
+        exec ssh -k -l root "$@"
+        ;;
+    rlogin)
+        klist -s || krbroot init || exit 1;
+        exec rlogin -x -l root $2
+        ;;
+    *)
+        if [ $# = 0 ]; then
+            echo "Usage: $0 init" >&2
+            echo "       $0 destroy" >&2
+            echo "       $0 shell" >&2
+            echo "       $0 ssh [args]" >&2
+            echo "       $0 rlogin [args]" >&2
+            echo "       $0 [cmd]" >&2
+        else
+            exec "$@"
+        fi
+        ;;
+esac