Update for OPIE use in CURRENT.

Tested against:	"make lint" using the docproj port.
This commit is contained in:
Mark Murray 2001-09-19 14:05:27 +00:00
parent 92d186764c
commit 1d36303c9d
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10756

View file

@ -1,7 +1,7 @@
<!-- <!--
The FreeBSD Documentation Project The FreeBSD Documentation Project
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/security/chapter.sgml,v 1.80 2001/09/13 20:06:28 logo Exp $ $FreeBSD: doc/en_US.ISO8859-1/books/handbook/security/chapter.sgml,v 1.81 2001/09/13 22:11:10 logo Exp $
--> -->
<chapter id="security"> <chapter id="security">
@ -984,73 +984,82 @@ lrwxr-xr-x 1 root wheel 15 Mar 19 06:56 libcrypt_p.a -&gt; libdescrypt_p.a</s
growing number of other operating systems. S/Key is a registered growing number of other operating systems. S/Key is a registered
trademark of Bell Communications Research, Inc.</para> trademark of Bell Communications Research, Inc.</para>
<para>From version 5.0 of FreeBSD, S/Key has been replaced with
the functionally equivalent OPIE (Onetime Passwords In
Everything). OPIE uses the MD5 hash by default.</para>
<para>There are three different sorts of passwords which we will talk <para>There are three different sorts of passwords which we will talk
about in the discussion below. The first is your usual Unix-style or about in the discussion below. The first is your usual Unix-style or
Kerberos password; we will call this a <quote>Unix password</quote>. Kerberos password; we will call this a <quote>Unix password</quote>.
The second sort is the one-time password which is generated by the The second sort is the one-time password which is generated by the
S/Key <command>key</command> program and accepted by the S/Key <command>key</command> program or the OPIE
<command>keyinit</command> program and the login prompt; we will <command>opiekey</command> program and accepted by the
<command>keyinit</command> or <command>opiepasswd</command> programs
and the login prompt; we will
call this a <quote>one-time password</quote>. The final sort of call this a <quote>one-time password</quote>. The final sort of
password is the secret password which you give to the password is the secret password which you give to the
<command>key</command> program (and sometimes the <command>key</command>/<command>opiekey</command> programs (and
<command>keyinit</command> program) which it uses to generate sometimes the
<command>keyinit</command>/<command>opiepasswd</command> programs)
which it uses to generate
one-time passwords; we will call it a <quote>secret password</quote> one-time passwords; we will call it a <quote>secret password</quote>
or just unqualified <quote>password</quote>.</para> or just unqualified <quote>password</quote>.</para>
<para>The secret password does not have anything to do with your Unix <para>The secret password does not have anything to do with your Unix
password; they can be the same but this is not recommended. S/Key password; they can be the same but this is not recommended. S/Key
secret passwords are not limited to 8 characters like Unix passwords, and OPIE secret passwords are not limited to 8 characters like Unix
they can be as long as you like. Passwords of six or seven word passwords, they can be as long as you like. Passwords of six or
long phrases are fairly common. For the most part, the S/Key system seven word long phrases are fairly common. For the most part, the
operates completely independently of the Unix password S/Key or OPIE system operates completely independently of the Unix
system.</para> password system.</para>
<para>Besides the password, there are two other pieces of data that <para>Besides the password, there are two other pieces of data that
are important to S/Key. One is what is known as the are important to S/Key and OPIE. One is what is known as the
<quote>seed</quote> or <quote>key</quote>, consisting of two letters <quote>seed</quote> or <quote>key</quote>, consisting of two letters
and five digits. The other is what is called the <quote>iteration and five digits. The other is what is called the <quote>iteration
count</quote>, a number between 1 and 100. S/Key creates the count</quote>, a number between 1 and 100. S/Key creates the
one-time password by concatenating the seed and the secret password, one-time password by concatenating the seed and the secret password,
then applying the MD4 hash as many times as specified by the then applying the MD4/MD5 hash as many times as specified by the
iteration count and turning the result into six short English words. iteration count and turning the result into six short English words.
These six English words are your one-time password. The These six English words are your one-time password. The
<command>login</command> and <command>su</command> programs keep authentication system (primarily PAM) keeps
track of the last one-time password used, and the user is track of the last one-time password used, and the user is
authenticated if the hash of the user-provided password is equal to authenticated if the hash of the user-provided password is equal to
the previous password. Because a one-way hash is used it is the previous password. Because a one-way hash is used it is
impossible to generate future one-time passwords if a successfully impossible to generate future one-time passwords if a successfully
used password is captured; the iteration count is decremented after used password is captured; the iteration count is decremented after
each successful login to keep the user and the login program in each successful login to keep the user and the login program in
sync. When the iteration count gets down to 1, S/Key must be sync. When the iteration count gets down to 1, S/Key and OPIE must be
reinitialized.</para> reinitialized.</para>
<para>There are four programs involved in the S/Key system which we <para>There are three programs involved in each system
will discuss below. The <command>key</command> program accepts an which we will discuss below. The <command>key</command> and
iteration count, a seed, and a secret password, and generates a <command>opiekey</command> programs accept an iteration
one-time password. The <command>keyinit</command> program is used count, a seed, and a secret password, and generate a one-time
to initialize S/Key, and to change passwords, iteration counts, or password or or a consecutive list of one-time passwords. The
seeds; it takes either a secret password, or an iteration count, <command>keyinit</command> and <command>opiepasswd</command>
seed, and one-time password. The <command>keyinfo</command> program programs are used to initialize S/Key and OPIE respectively,
examines the <filename>/etc/skeykeys</filename> file and prints out and to change passwords, iteration counts, or seeds; they
the invoking user's current iteration count and seed. Finally, the take either a secret passphrase, or an iteration count,
<command>login</command> and <command>su</command> programs contain seed, and one-time password. The <command>keyinfo</command>
the necessary logic to accept S/Key one-time passwords for and <command>opieinfo</command> programs examine the
authentication. The <command>login</command> program is also relevant credentials files (<filename>/etc/skeykeys</filename> or
capable of disallowing the use of Unix passwords on connections <filename>/etc/opiekeys</filename>) and print out the invoking user's
coming from specified addresses.</para> current iteration count and seed.</para>
<para>There are four different sorts of operations we will cover. The <para>There are four different sorts of operations we will cover. The
first is using the <command>keyinit</command> program over a secure first is using <command>keyinit</command> or
connection to set up S/Key for the first time, or to change your <command>opiepasswd</command> over a secure connection to set up
password or seed. The second operation is using the one-time-passwords for the first time, or to change your password
<command>keyinit</command> program over an insecure connection, in or seed. The second operation is using <command>keyinit</command>
conjunction with the <command>key</command> program over a secure or <command>opiepasswd</command> over an insecure connection, in
connection, to do the same. The third is using the conjunction with <command>key</command> or <command>opiekey</command>
<command>key</command> program to log in over an insecure over a secure connection, to do the same. The third is using
connection. The fourth is using the <command>key</command> program <command>key</command>/<command>opiekey</command> to log in over
to generate a number of keys which can be written down or printed an insecure connection. The fourth is using <command>key</command>
out to carry with you when going to some location without secure or <command>opiekey</command> to generate a number of keys which
connections to anywhere.</para> can be written down or printed out to carry with you when going to
some location without secure connections to anywhere.</para>
<sect2> <sect2>
<title>Secure Connection Initialization</title> <title>Secure Connection Initialization</title>
@ -1071,12 +1080,28 @@ Again secret password:
ID unfurl s/key is 99 to17757 ID unfurl s/key is 99 to17757
DEFY CLUB PRO NASH LACE SOFT</screen> DEFY CLUB PRO NASH LACE SOFT</screen>
<para>At the <prompt>Enter secret password:</prompt> prompt, you <para>For OPIE, <command>opiepasswd</command> is used instead:</para>
<screen>&prompt.user; <userinput>opiepasswd -c</userinput>
[grimreaper] ~ $ opiepasswd -f -c
Adding unfurl:
Only use this method from the console; NEVER from remote. If you are using
telnet, xterm, or a dial-in, type ^C now or exit with no password.
Then run opiepasswd without the -c parameter.
Using MD5 to compute responses.
Enter new secret pass phrase:
Again new secret pass phrase:
ID unfurl OTP key is 499 to4268
MOS MALL GOAT ARM AVID COED
</screen>
<para>At the <prompt>Enter new secret pass phrase:</prompt> or
<prompt>Enter secret password:</prompt> prompts, you
should enter a password or phrase. Remember, this is not the should enter a password or phrase. Remember, this is not the
password that you will use to login with, this is used to generate password that you will use to login with, this is used to generate
your one-time login keys. The <quote>ID</quote> line gives the your one-time login keys. The <quote>ID</quote> line gives the
parameters of your particular S/Key instance; your login name, the parameters of your particular instance; your login name, the
iteration count, and seed. When logging in with S/Key, the system iteration count, and seed. When logging in the system
will remember these parameters and present them back to you so you will remember these parameters and present them back to you so you
do not have to remember them. The last line gives the particular do not have to remember them. The last line gives the particular
one-time password which corresponds to those parameters and your one-time password which corresponds to those parameters and your
@ -1087,10 +1112,10 @@ DEFY CLUB PRO NASH LACE SOFT</screen>
<sect2> <sect2>
<title>Insecure Connection Initialization</title> <title>Insecure Connection Initialization</title>
<para>To initialize S/Key or change your secret password over an <para>To initialize change your secret password over an
insecure connection, you will need to already have a secure insecure connection, you will need to already have a secure
connection to some place where you can run the connection to some place where you can run <command>key</command>
<command>key</command> program; this might be in the form of a or <command>opiekey</command>; this might be in the form of a
desk accessory on a Macintosh, or a shell prompt on a machine you desk accessory on a Macintosh, or a shell prompt on a machine you
trust. You will also need to make up an iteration count (100 is trust. You will also need to make up an iteration count (100 is
probably a good value), and you may make up your own seed or use a probably a good value), and you may make up your own seed or use a
@ -1105,7 +1130,26 @@ Reminder you need the 6 English words from the key command.
Enter sequence count from 1 to 9999: <userinput>100</userinput> Enter sequence count from 1 to 9999: <userinput>100</userinput>
Enter new key [default to17759]: Enter new key [default to17759]:
s/key 100 to 17759 s/key 100 to 17759
s/key access password:</screen> s/key access password:
s/key access password:<userinput>CURE MIKE BANE HIM RACY GORE</userinput>
</screen>
<para>For OPIE, you need to use <command>opiepasswd</command>:</para>
<screen>&prompt.user; <userinput>opiepasswd</userinput>
Updating unfurl:
You need the response from an OTP generator.
Old secret pass phrase:
otp-md5 498 to4268 ext
Response: GAME GAG WELT OUT DOWN CHAT
New secret pass phrase:
otp-md5 499 to4269
Response: LINE PAP MILK NELL BUOY TROY
ID mark OTP key is 499 gr4269
LINE PAP MILK NELL BUOY TROY
</screen>
<para>To accept the default seed (which the <para>To accept the default seed (which the
<command>keyinit</command> program confusingly calls a <command>keyinit</command> program confusingly calls a
@ -1118,22 +1162,23 @@ Reminder - Do not use this program while logged in via telnet or rlogin.
Enter secret password: <userinput>&lt;secret password&gt;</userinput> Enter secret password: <userinput>&lt;secret password&gt;</userinput>
CURE MIKE BANE HIM RACY GORE</screen> CURE MIKE BANE HIM RACY GORE</screen>
<para>Or for OPIE:</para>
<screen>&prompt.user; <userinput>opiekey 498 to4268</userinput>
Using the MD5 algorithm to compute response.
Reminder: Don't use opiekey from telnet or dial-in sessions.
Enter secret pass phrase:
GAME GAG WELT OUT DOWN CHAT
</screen>
<para>Now switch back over to the insecure connection, and copy the <para>Now switch back over to the insecure connection, and copy the
one-time password generated by <command>key</command> over to the one-time password generated over to the relevant program.</para>
<command>keyinit</command> program:</para>
<screen>s/key access password:<userinput>CURE MIKE BANE HIM RACY GORE</userinput>
ID unfurl s/key is 100 to17759
CURE MIKE BANE HIM RACY GORE</screen>
<para>The rest of the description from the previous section applies
here as well.</para>
</sect2> </sect2>
<sect2> <sect2>
<title>Generating a Single one-time Password</title> <title>Generating a Single one-time Password</title>
<para>Once you have initialized S/Key, when you login you will be <para>Once you have initialized S/Key or OPIE, when you login you will be
presented with a prompt like this:</para> presented with a prompt like this:</para>
<screen>&prompt.user; <userinput>telnet example.com</userinput> <screen>&prompt.user; <userinput>telnet example.com</userinput>
@ -1147,15 +1192,24 @@ login: <userinput>&lt;username&gt;</userinput>
s/key 97 fw13894 s/key 97 fw13894
Password: </screen> Password: </screen>
<para>As a side note, the S/Key prompt has a useful feature <Para>Or for OPIE:</para>
<screen>&prompt.user; <userinput>telnet example.com</userinput>
Trying 10.0.0.1...
Connected to example.com
Escape character is '^]'.
FreeBSD/i386 (example.com) (ttypa)
login: <userinput>&lt;username&gt;</userinput>
otp-md5 498 gr4269 ext
Password: </screen>
<para>As a side note, the S/Key and OPIE prompts have a useful feature
(not shown here): if you press return at the password prompt, the (not shown here): if you press return at the password prompt, the
login program will turn echo on, so you can see what you are prompter will turn echo on, so you can see what you are
typing. This can be extremely useful if you are attempting to typing. This can be extremely useful if you are attempting to
type in an S/Key by hand, such as from a printout. Also, if this type in a password by hand, such as from a printout.</para>
machine were configured to disallow Unix passwords over a
connection from the source machine, the prompt would have also included
the annotation <literal>(s/key required)</literal>, indicating
that only S/Key one-time passwords will be accepted.</para>
<indexterm><primary>MS-DOS</primary></indexterm> <indexterm><primary>MS-DOS</primary></indexterm>
<indexterm><primary>Windows</primary></indexterm> <indexterm><primary>Windows</primary></indexterm>
@ -1163,12 +1217,12 @@ Password: </screen>
<para>At this point you need to generate your one-time password to <para>At this point you need to generate your one-time password to
answer this login prompt. This must be done on a trusted system answer this login prompt. This must be done on a trusted system
that you can run the <command>key</command> command on. (There that you can run <command>key</command> or
are versions of the <command>key</command> program for MS-DOS, <command>opiekey</command> on. (There are versions of these for DOS,
Windows and MacOS as well.) The <command>key</command> program Windows and MacOS as well.) They need both the iteration count and
needs both the iteration count and the seed as command line the seed as command line options. You can cut-and-paste these
options. You can cut-and-paste these right from the login prompt right from the login prompt on the machine that you are logging
on the machine that you are logging in to.</para> in to.</para>
<para>On the trusted system:</para> <para>On the trusted system:</para>
@ -1177,6 +1231,14 @@ Reminder - Do not use this program while logged in via telnet or rlogin.
Enter secret password: Enter secret password:
WELD LIP ACTS ENDS ME HAAG</screen> WELD LIP ACTS ENDS ME HAAG</screen>
<para>For OPIE:</para>
<screen>&prompt.user; <userinput>opiekey 498 to4268</userinput>
Using the MD5 algorithm to compute response.
Reminder: Don't use opiekey from telnet or dial-in sessions.
Enter secret pass phrase:
GAME GAG WELT OUT DOWN CHAT</screen>
<para>Now that you have your one-time password you can continue <para>Now that you have your one-time password you can continue
logging in:</para> logging in:</para>
@ -1187,12 +1249,6 @@ s/key 97 fw13894
Password [echo on]: WELD LIP ACTS ENDS ME HAAG Password [echo on]: WELD LIP ACTS ENDS ME HAAG
Last login: Tue Mar 21 11:56:41 from 10.0.0.2 ... </screen> Last login: Tue Mar 21 11:56:41 from 10.0.0.2 ... </screen>
<para>This is the easiest mechanism <emphasis>if</emphasis> you have
a trusted machine. There is a Java S/Key <command>key</command>
applet, <ulink
url="http://www.cs.umd.edu/~harry/jotp/src.html">The Java OTP
Calculator</ulink>, that you can download and run locally on any
Java supporting browser.</para>
</sect2> </sect2>
<sect2> <sect2>