1 alias kssh='ssh -o preferredauthentications=gssapi-with-mic'
2 alias pssh='ssh -o preferredauthentications=password,keyboard-interactive'
4 if [ $UID -gt 0 -a -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then
6 if klist -s 2>/dev/null; then
7 # We already have a ticket cache. Renew it.
10 # Try to find an existing cache but only if we are using FILE: caches.
11 default=$((unset KRB5CCNAME; klist 2>&1) | sed -n 's/.*FILE:\([^)]*\).*/\1/p')
12 if [ ! -z "$default" ]; then
13 # Check for Exceed onDemand stupidity.
14 if [ "$KRB5CCNAME" = "FILE:" ]; then
18 # Check for bogus FILE: KRB5CCNAME.
19 if [ ! -z "$KRB5CCNAME" -a "${KRB5CCNAME##*:}" = "$KRB5CCNAME" ]; then
20 export KRB5CCNAME="FILE:$KRB5CCNAME"
24 ccname="${KRB5CCNAME##FILE:}"
25 if [ "$ccname" = "$KRB5CCNAME" ]; then
26 # Our cache isn't a file cache. Throw it away.
31 # Remember if nullglob was on.
34 # Turn it on so we can look for caches safely.
37 for cache in $default*; do
38 if klist -s -c "$cache"; then
39 if [ ! "$cache" = "$ccname" ]; then
40 # It may not be safe to simply point the environment to this
41 # cache as it may belong to a session which is about to end.
42 # Therefore we copy it.
43 cp -p "$cache" "$ccname" || continue
50 # Maybe turn nocaseglob back off.
51 [ $ng = 0 ] || shopt -u nullglob
55 # By now we should have found a cache if there's one to find.
56 klist -s 2>/dev/null || kinit
60 unset cache ccname default ng