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 bogus FILE: KRB5CCNAME.
14 if [ ! -z "$KRB5CCNAME" -a "${KRB5CCNAME##*:}" = "$KRB5CCNAME" ]; then
15 export KRB5CCNAME="FILE:$KRB5CCNAME"
19 ccname="${KRB5CCNAME##FILE:}"
20 if [ "$ccname" = "$KRB5CCNAME" ]; then
21 # Our cache isn't a file cache. Throw it away.
26 # Remember if nullglob was on.
29 # Turn it on so we can look for caches safely.
32 for cache in $default*; do
33 if klist -s -c "$cache"; then
34 if [ ! "$cache" = "$ccname" ]; then
35 # It may not be safe to simply point the environment to this
36 # cache as it may belong to a session which is about to end.
37 # Therefore we copy it.
38 cp -p "$cache" "$ccname" || continue
45 # Maybe turn nocaseglob back off.
46 [ $ng = 0 ] || shopt -u nullglob
50 # By now we should have found a cache if there's one to find.
51 klist -s 2>/dev/null || kinit
55 unset cache ccname default ng