source: trunk/debathena/config/ssh-server-config/debian/10-bash-kerberos-credentials-warn @ 24039

Revision 24039, 1.0 KB checked in by broder, 15 years ago (diff)
In ssh-server-config: * Put a blank line before and after any ticket/token warnings.
Line 
1# If a user logs in without tickets and tokens, display a warning
2# message to let them know
3
4# Check to make sure the user does not have a local account, and that
5# it's an interactive login
6if [ "$DEBATHENA_HOME_TYPE" = "afs" ] && [ "$PS1" ]; then
7    tickets=
8    tokens=
9
10    # Check for tokens
11    if tokens | grep -q 'athena\.mit\.edu'; then
12        tokens="yes"
13    fi
14
15    # Check for tickets
16    if klist -s; then
17        tickets="yes"
18    fi
19
20    if [ -z "$tokens" ] && [ -z "$tickets" ] && [ ! -r ~/.bashrc ]; then
21        echo >&2
22        echo "WARNING: You have no valid Kerberos tickets and no valid AFS tokens." >&2
23        echo "See http://debathena.mit.edu/ssh" >&2
24        echo >&2
25    elif [ -z "$tokens" ] && [ ! -r ~/.bashrc ]; then
26        echo >&2
27        echo "WARNING: You have no valid AFS tokens." >&2
28        echo "See http://debathena.mit.edu/ssh" >&2
29        echo >&2
30    elif [ -z "$tickets" ]; then
31        echo >&2
32        echo "WARNING: You have no valid Kerberos tickets." >&2
33        echo "See http://debathena.mit.edu/ssh" >&2
34        echo >&2
35    fi
36fi
Note: See TracBrowser for help on using the repository browser.