Commands / Directories and tickets

Directories and tickets

sclient

Also sserver, sendauth, AP_REQ, kerberos sample client

MIT's sample Kerberos client: opens a service with a ticket, and prints who the service says you are.

sclient HOST PORT SERVICE connects to a Kerberos service, takes a ticket for SERVICE/HOST from the ticket cache (asking the KDC for one first if the cache has none), and sends it with a fresh authenticator, in one AP_REQ (sendauth). sserver, the matching server, opens the ticket with the key in its keytab, checks the authenticator's time against its own clock, and answers You are PRINCIPAL. Neither one asks for a password: they show the ticket exchange every Kerberos service does underneath. A refusal comes back as sendauth rejected, with the server's reason.

sclient command usage

sclient HOST PORT SERVICE
sserver -s SERVICE -S KEYTAB

Options

SERVICE
sclient: the service's name; the ticket is for SERVICE/HOST
-s SERVICE
sserver: the service it answers for
-S KEYTAB
sserver: the keytab that holds the service's key

sclient examples

sclient archive.lab 4444 archive
Opens the archive service with a ticket, and prints who it says you are.
sserver -s archive -S /etc/krb5.keytab
Answers for the archive service, opening each ticket with the key in the keytab.

Pitfalls

  • No credentials cache found: there is no ticket-granting ticket to get a service ticket with; run kinit first.
  • sendauth rejected, Clock skew too great: the client's clock and the server's are more than five minutes apart.
  • sendauth rejected, Key version is not available: the server's keytab lacks the key the ticket was locked with.

Run it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab