Troubleshooting Kerberos and SSH problems
1. Kerberos kinit Problems
2. SSH Problems
1. Kerberos kinit Problems
Cannot find KDC for requested realm while getting
file doesn't contain .FNAL.GOV information
1. Replace /etc/krb5.conf
with Fermilab-supplied version of krb5.conf
2. Modify /etc/krb5.conf
Fermi-specific stanzas as instructed here
3. If user does not have
permission to modify /etc/krb5.conf,
Fermilab-supplied version into home area, and do
to tell all Kerberos
commands to use the user's copy of krb5.conf.
On Macintosh computers
(OS-X operating system), Kerberos is installed on
all recent versions.
However, there are two locations and names for krb5.conf
(Note: the file in /Library
Either will work, but you
should only have one. Updated 10/11/2012: Several Mac OS-X 10.6.8 users have reported that only the /etc/krb5.conf file worked for them.
kinit: Unable to acquire credentials for 'user@FNAL.GOV': Cannot contact any KDC for realm 'FNAL.GOV'
You are behind a firewall or are using an internet connection which has a "NAT" (Network Address Translation), such as on a home wireless router
1. Ping one of the Fermilab Kerberos Authentication servers (such as krb-fnal-1.fnal.gov
) to make sure you can reach the server at the other end. If successful move to step 2.
2. Request an addressless Kerberos ticket as follows:
If you do
you should see as the last line
getting initial credentials
Problem: kinit fails with
1. Usually the problem is simply that you have typed in your kerberos
password incorrectly. Try again.
2. If you have lost your kerberos password, call the Fermilab Service Desk
630-840-2345, during business hours to have the password reset.
3. Occassionally this is not a password problem, but a problem with your
system's clock. Make sure that the date
command returns a time
correct to within 5 minutes.
Problem: kinit fails with time skew
1. Your system clock must be within 5 minutes of the correct value.
has no support for encryption
type while getting initial credentials
Problem: kinit fails with complaint
about encryption type
1. This problem appears on recent Ubuntu and related Linux
To fix, edit /etc/krb5.conf
file, and in the [libdefaults] section
not found in Kerberos
database while getting initial credentials
Problem: kinit fails with database
1. Your kerberos principal may differ from your username on your local
system. Use kinit
where username is your
Fermilab kerberos principle. kinit
itself will use your local
2. Your Fermilab ID or visitor ID has expired. Please see the renewal
instructions at Accounts
entry in database has
Problem: kinit fails because of an
1. You must change your kerberos password once a year with the kpasswd
command (the same command you used to change your initial kerberos
password). You can try to change your password, even if it is
expired, by using kpasswd
your local machine. More detailed instructions are available here
2. You can call the Fermilab Service
, 630-840-2345, and request that
they reset your kerberos password.
2. SSH Problems
and compare this challenge to the one on your display
. . .
ssh login failures will be
indicated by either permission denied
by a cryptocard prompt. If you plan to use a CryptoCard for
authentication then please
read the CryptoCard use notes posted here
If none of the solutions below fixes your problem please
email the output of the command ssh -vvv
for further assistance.
Problem: Not having a kerberos
ticket granting ticket (TGT), or
having an expired TGT
Verify with the klist -f
command that you have a ticket. If you
don't have a ticket, or have an expired ticket, get a new ticket
-fr 7d username@FNAL.GOV
09:31:16 08/18/12 11:31:16 krbtgt/FNAL.GOV@FNAL.GOV
08/24/12 09:31:09, Flags: FRIA
Normal output, indicating that a forwardable, renewable, ticket exists.
Check the expiration time - if the current time is past the expiration,
login attempts will fail.
No credentials cache file found (ticket cache /tmp/krb5cc_5598)
If you see the above message you do not have a Kerberos ticket.
to get a ticket before attempting to login.
Kerberos tickets expire after 24 hours. If you include the
7d switch on your kinit
command line, you will receive
a renewable ticket. Renewable tickets may be renewed by
-R before they expire at the end of any 24
hour period. Tickets are renewable for up to the period
specified in the -r switch,
to a maximum of 7 days.
Another useful switch to kinit is -f, which
asks for a
forwardable ticket. If you have a forwardable ticket, once
you login to a Fermilab machine, say jpsi1.fnal.gov,
then login from jpsi1 to
another machine, say ds1.fnal.gov,
without doing a new kinit. It
is in general a bad idea to
on any machine but your local system, as your
password may be captured as it traverses the internet. The
only time typing a kinit
password is safe on a remote machine
is when you are using an encrypted connection, like with ssh.
Problem: Not having an account on
the target machine, or having
an account on the target machine under a different username.
error will occur if you do not have an account
on the target machine, or if your username on the target machine
differs from your username on your local machine. Try
-l username jpsi1.fnal.gov
where username is your Fermilab username (the same name that you
used in your kinit
command). If this fails, send e-mail to
and ask that the administrators verify that you have a valid
account on the Fermilab lattice QCD systems.
Problem: Using an internet
connection which has a "NAT" (Network
Address Translation), such as on a home wireless router
Nearly all home routers, wired or wireless, have a "NAT" function,
which results in your local system having a different local network
address than what is presented to remote machines. This allows you
to have multiple local machines and only one external IP address.
You local addresses will generally be something like 192.168.X.Y,
or 10.X.Y.Z, when a NAT is present.
With a NAT, your ssh logins may fail with Incorrect net
To fix this, use "addressless" tickets. First, use kdestroy
to delete your current ticket. Then, use kinit with -a, -A,
to request an addressless ticket. The switch required
varies with kerberos versions, so use man kinit
on your local
system to determine which of these three switches to use.
For Mac OS users, please be
aware that between versions 10.5 and
10.6 Apple changed the switch for addressless tickets from
if you have recently upgraded from Leopard (10.5)
to Snow Leopard (10.6) and are still using -A you will
change to -a.
the default behaviour on Mac OS is to supply
addressless tickets, so you should also be able to simply drop the
Problem: Using an ssh client
which does not have Kerberos
Some versions of ssh will not attempt to perform kerberos
authentication. In this case, you will either receive a permission
error, or a cryptocard prompt. To enable kerberos
authentication, try the following -o switch:
-o "GSSAPIAuthentication yes" email@example.com
The quotation marks are required. If this form of ssh succeeds,
you can configure your local system to always attempt to use
kerberos authentication by editing either $HOME/.ssh/config
and adding these lines:
line is necessary if you want to
use X-windows clients on the remote (Fermilab) system.
Note that you may also need a -X or -Y switch
on your ssh command
to enable X forwarding.
Problem: Setting up an ssh tunnel to access kaon1 via a single hop.
As with other facilities that use ssh gateway nodes, you may find it
convenient to use ssh tunneling to access kaon1 via a single hop. An example
command to use on your local machine to setup a tunnel is:
ssh -X -f -N -L 2222:kaon1.fnal.gov:22 firstname.lastname@example.org
where "username" is your Fermilab username. After this command returns, you
can login to kaon1 by using
ssh -p 2222 username@localhost
Note that "2222" is the port number of the end of the tunnel on your local
machine. You can use any large number (> 1000) for this port.
The syntax is slightly different for the scp command:
scp -P 2222 username@localhost:file file
scp -P 2222 file username@localhost:file
If you get a
"Permission denied" error message then follow the steps listed below:
Step1: Generate a ssh public private key pair if you do not have one using the
ssh-keygen command which will save the keys at
$HOME/.ssh/ on the machine
ssh-keygen command is executed. If you already have a private public ssh key pair then go to step 2.
Step2: Append the contents of the public ssh key file (
$HOME/.ssh/authorized_keys file on kaon1.
for a description of the "tunnel.pl" tool which will setup ssh tunnels for
If you still have any questions or issues with kaon please
send email to email@example.com.