UNIX 版の OTP 計算プログラムは、opie (One-time Passwords In Everything) パッケージに含まれています。 opie の最新バージョンは 2.3 なのですが、 2.3 にはいくつか不具合が発見されています。 そこで、 ここでは 2.3 よりも安定している 2.22 版をインストールすることにします。
% ftp ftp.st.ryukoku.ac.jp Connected to starbow.st.ryukoku.ac.jp. 220 starbow.st.ryukoku.ac.jp FTP server (Version wu-2.4.2-academ[BETA-16](1/Address-Proofed_1.2.1) Thu Jan 8 12:41:58 JST 1998) ready. Name (ftp.st.ryukoku.ac.jp:kjm): ftp 331 Anonymous FTP ready, send your COMPLETE e-mail address as password. Password: hogehoge@hoge.or.jp 230- 230-Your E-mail address [hogehoge@hoge.or.jp] 230-Your host machine [ppp012345.hoge.or.jp] 230- 230-starbow.st.ryukoku.ac.jp accepted access from ppp012345.hoge.or.jp, 230-as user ftp. 230- 230-Welcome to 230- 230- #### ##### ## ##### ##### #### # # 230- # # # # # # # # # # # # 230- #### # # # # # ##### # # # # 230- # # ###### ##### # # # # # ## # 230- # # # # # # # # # # # ## ## 230- #### # # # # # ##### #### # # 230- 230-anonymous FTP server. This server is also known as 'ftp.st.ryukoku.ac.jp'. 230-There are 1 users, max users = unlimited (-1 = no limit). 230- 230-* You can search this ftp site via WWW. Try to access: 230- 230- http://ftp.st.ryukoku.ac.jp/cgi-bin/archie.cgi 230- 230- You can search only this site and ftp.ryukoku.ac.jp via above page. 230- 230-* If you have any trouble, please mail to ftp-admin@ftp.st.ryukoku.ac.jp. 230- 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /pub/security/tool/opie/old 250 CWD command successful. ftp> binary 200 Type set to I. ftp> get opie-2.22.tar.gz 200 PORT command successful. 150 Opening BINARY mode data connection for opie-2.22.tar.gz (175116 bytes). 226 Transfer complete. 175116 bytes received in 1.9 seconds (90 Kbytes/s) ftp> quit 221 Goodbye. %
% gzip -cd opie-2.22.tar.gz |tar xf - %
% cd opie-2.22 %
% ./configure creating cache ./config.cache checking for gcc... cc checking whether we are using GNU C... no checking how to run the C preprocessor... cc -E checking whether ln -s works... yes checking for ranlib... ranlib checking for bison... no checking for byacc... no checking for AIX... no checking for POSIXized ISC... no checking for minix/config.h... no checking for chown... /usr/bin/chown checking for su... /usr/bin/su checking for su... /sbin/su checking for scheme... no checking for login... /usr/bin/login checking for ftpd... no checking for in.ftpd... /usr/sbin/in.ftpd checking for default PATH entries... /usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc checking for test -e flag... no checking for mkdir -p flag... yes checking for ls -g flag... yes, but it's broken checking for /etc/default/login... yes checking for /etc/securetty... no checking for /etc/logindevperm... no checking for /etc/fbtab... no checking for /etc/shadow... yes checking mail spool location... /usr/mail checking where your system puts the utmp file... /etc checking where your system puts the utmpx file... /etc checking where your system puts the wtmp file... /etc checking where your system puts the wtmpx file... /etc checking whether the system profile displays the motd... yes checking whether the system profile checks for mail... no checking for working const... yes checking to see if your compiler can handle void arguments... yes checking to see if your compiler can handle void return values... yes checking to see if your compiler can handle void pointers... no checking to see if your compiler can handle ANSI argument lists... yes checking to see if your compiler can handle ANSI prototypes... yes checking to see if your compiler can handle ANSI variable arguments... yes checking for -lcrypt... yes checking for -lnsl... yes checking for -lposix... no checking for -lsocket... yes checking for dirent.h that defines DIR... yes checking for -ldir... no checking for sys/wait.h that is POSIX.1 compatible... yes checking for crypt.h... yes checking for fcntl.h... yes checking for limits.h... yes checking for termios.h... yes checking for sys/file.h... yes checking for sys/ioctl.h... yes checking for sys/time.h... yes checking for syslog.h... yes checking for unistd.h... yes checking for paths.h... no checking for shadow.h... yes checking for signal.h... yes checking for sys/signal.h... yes checking for lastlog.h... yes checking for sys/utsname.h... yes checking for pwd.h... yes checking for sys/param.h... yes checking for string.h... yes checking for stdlib.h... yes checking for ut_pid in struct utmp... yes checking for ut_type in struct utmp... yes checking return type of signal handlers... void checking for gethostname... yes checking for gettimeofday... yes checking for mkdir... yes checking for rmdir... yes checking for socket... yes checking for strftime... yes checking for strstr... yes checking for setpriority... no checking for getutxline... yes checking for seteuid... yes checking for setreuid... no checking for setegid... yes checking for setregid... no checking for setresuid... no checking for setresgid... no checking for atexit... yes checking for on_exit... no checking for strchr... yes checking for index... yes checking for strrchr... yes checking for rindex... yes checking for getcwd... yes checking for getwd... no checking for sigsuspend... yes checking for sigpause... yes checking for sigblock... no checking for getttynam... no checking for sysconf... yes checking for getdtablesize... no checking for setvbuf... yes checking for memcpy... yes checking for memset... yes checking for bcopy... yes checking for bzero... yes checking for sigemptyset... yes checking for sigaddset... yes checking for getspent... yes checking for endspent... yes checking for sigmask... no checking for setgroups... yes checking for getgroups... yes checking for fpurge... no checking for setlogin... no checking for sigmask as a macro... yes checking whether cross-compiling... no checking for 8-bit clean memcmp... yes checking for working alloca.h... yes checking for alloca... yes checking for getusershell... yes checking for sigprocmask... yes checking for strerror... yes checking for sigemptyset... (cached) yes checking for sigaddset... (cached) yes checking for uname... yes checking for memcpy... (cached) yes checking for memset... (cached) yes checking for strncasecmp... yes checking for getenv... yes checking for setenv... no checking for unsetenv... no checking for nonstandard gettimeofday... no updating cache ./config.cache creating ./config.status creating configure.munger creating Makefile.munge creating config.h Binaries are going to be installed into /usr/local/bin, Manual pages are going to be installed into /usr/local/man. creating Makefile Have you read the README file? %
% make autoconf-client make CHOWN="/usr/bin/chown" EXISTS="-f" MKDIR="mkdir -p" RANLIB="ranlib" LOCALBIN="/usr/local/bin" LOCALMAN="/usr/local/man" SU="/usr/bin/su" ALT_SU="/sbin/su" LOGIN="/usr/bin/login" DEFAULT_PATH="/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc" FTPD="/usr/sbin/in.ftpd" LIBS="-lsocket -lnsl -lcrypt " OPTIONS="-DHAVE_CONFIG_H" CC="cc" YACC="yacc" MISSING=" env.o env.o " client (cd libopie ; make libopie.a CFL='-DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1' RANLIB='ranlib') cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c md4c.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c md5c.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c atob8.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c btoa8.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c challenge.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c getsequence.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c hash.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c keycrunch.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c lock.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c lookup.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c newseed.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c passcheck.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c passwd.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c randomchallenge.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c readpass.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c unlock.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c verify.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c version.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c btoe.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c accessfile.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c generator.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c insecure.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c pututmpentry.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c getutmpentry.c ar r libopie.a md4c.o md5c.o atob8.o btoa8.o challenge.o getsequence.o hash.o keycrunch.o lock.o lookup.o newseed.o passcheck.o passwd.o randomchallenge.o readpass.o unlock.o verify.o version.o btoe.o accessfile.o generator.o insecure.o pututmpentry.o getutmpentry.o ar: Warning: creating libopie.a ranlib libopie.a || /bin/true (cd libmissing ; make libmissing.a CFL='-DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1' RANLIB='ranlib') cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c bogus.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -I.. -c env.c ar r libmissing.a bogus.o env.o env.o ar: Warning:ignoring second definition of setenv defined in archive ar: Warning:ignoring second definition of unsetenv defined in archive ar: Warning: creating libmissing.a ranlib libmissing.a cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -c opietest.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 opietest.o -Llibopie -lopie -lsocket -lnsl -lcrypt -Llibmissing -lmissing -o opietest ./opietest && touch opietest-passed opietest: executing 11 tests ( 1/11) testing opieatob8... passed ( 2/11) testing opiebtoa8... passed ( 3/11) testing opiebtoe... passed ( 4/11) testing opieetob... passed ( 5/11) testing opiegenerator... passed ( 6/11) testing opiegetsequence... passed ( 7/11) testing opiehash(MD4)... passed ( 8/11) testing opiehash(MD5)... passed ( 9/11) testing opiekeycrunch... passed (10/11) testing opielock... passed (11/11) testing opieunlock... passed opietest: completed 11 tests. 11 tests passed, 0 tests failed. cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -c opiekey.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 opiekey.o -Llibopie -lopie -lsocket -lnsl -lcrypt -Llibmissing -lmissing -o opiekey cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 -c opiegen.c cc -DMDX=5 -DRETYPE=0 -DDEFAULT_PATH=\"/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc\" -DHAVE_CONFIG_H -DUSER_LOCKING=1 -DSU_STAR_CHECK=1 -DKEY_FILE=\"/etc/opiekeys\" -DNEW_PROMPTS=1 -D_OPIE=1 opiegen.o -Llibopie -lopie -lsocket -lnsl -lcrypt -Llibmissing -lmissing -o opiegen %
以上で終りです。One-Time Password 計算コマンド群は /usr/local/bin にインストールされますから、 ここに path が通っていることを確認してください。% su Password:input-root-password # make autoconf-client-install make CHOWN="/usr/bin/chown" EXISTS="-f" MKDIR="mkdir -p" RANLIB="ranlib" LOCALBIN="/usr/local/bin" LOCALMAN="/usr/local/man" SU="/usr/bin/su" ALT_SU="/sbin/su" LOGIN="/usr/bin/login" DEFAULT_PATH="/usr/bin:/usr/ucb:/usr/sbin:/sbin:/usr/bin/X11:/etc" FTPD="/usr/sbin/in.ftpd" LIBS="-lsocket -lnsl -lcrypt " OPTIONS="-DHAVE_CONFIG_H" CC="cc" YACC="yacc" MISSING=" env.o env.o " client-install Installing OPIE client software... Copying OPIE key-related files Changing file permissions Symlinking aliases to opiekey Installing manual pages # exit % rehash %