Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* putting passwords in auth.db
@ 1996-10-02  4:00 Steve VanDevender
  1996-10-09  4:00 ` Steve VanDevender
  1996-10-09  4:00 ` Todd Aven
  0 siblings, 2 replies; 4+ messages in thread
From: Steve VanDevender @ 1996-10-02  4:00 UTC (permalink / raw)



We have a group of AlphaStation 500 systems running Digital UNIX 4.0 on
which we want to mirror the /etc/passwd and /etc/shadow files from a
Solaris system, so that everyone who has access to the Solaris system
can also log in to the Digital UNIX systems.  Unfortunately Digital UNIX
doesn't support a shadow password file.  So far we've just been
converting the passwd/shadow file from the Solaris system to an
old-fashioned passwd file with the encrypted passwords in field 2;
however I feel a little uncomfortable exporting readable encrypted
passwords to systems that are extremely well-suited to cracking them
:-).  I've been studying the man pages for getprpwent()/putprpwent() and
tried writing some programs to scan and manipulate the
/var/tcb/files/auth.db database, but the routines don't quite seem to
work as documented; I'd like to just be able to take the shadow file and
stuff its encrypted passwords into auth.db to implement this.

Has anyone successfully used the getprpwent()/putprpwent() routines to
manipulate the auth.db database, or have other experience relevant to
using or converting shadow passwd files to work under Digital UNIX?

I've also heard recent mention of password distribution software for
Digital UNIX, but it didn't quite sound like it was suited to this
particular application.

We're a bit reluctant to use NIS as it seems like it would be harder to
secure than using standard shadow passwd files.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: putting passwords in auth.db
  1996-10-02  4:00 putting passwords in auth.db Steve VanDevender
@ 1996-10-09  4:00 ` Steve VanDevender
  1996-10-09  4:00 ` Todd Aven
  1 sibling, 0 replies; 4+ messages in thread
From: Steve VanDevender @ 1996-10-09  4:00 UTC (permalink / raw)



I've succeded in writing a program that takes more-or-less standard
/etc/passwd and /etc/shadow files and stuffs the passwords into the
protected password database used by Digital UNIX in ENHANCED security
mode, using the getprpwnam() and putprpwnam() functions.  It's currently
being tested on one of our Digital UNIX hosts with good results so far;
it accepts /etc/passwd and /etc/shadow from a Solaris host and everyone
we've tried so far is able to log in.

After I've had it running for a while longer and am more confident about
showing it to the world, I should be able to release the code.

The most interesting gotcha is that in ENHANCED security mode, Digital
UNIX treats characters in a password after the 8th as significant,
instead of truncating passwords to 8 characters before encrypting them
for comparison during login.  An early version of the program worked for
all but one of the testers, who happened to use a 9-character password.
Fortunately a semi-documented item in the pr_passwd structure,
ufld.fd_oldcrypt, can be used to set which kind of password encryption
you want to use, including the old truncate-to-8-chars-and-crypt()
behavior that is compatible with Solaris (and probably most other
UNIXen).  The default in Digital UNIX is apparently to encrypt passwords
in 8-character blocks and store all of the blocks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: putting passwords in auth.db
  1996-10-02  4:00 putting passwords in auth.db Steve VanDevender
  1996-10-09  4:00 ` Steve VanDevender
@ 1996-10-09  4:00 ` Todd Aven
  1996-10-10  4:00   ` Randy M. Hayman
  1 sibling, 1 reply; 4+ messages in thread
From: Todd Aven @ 1996-10-09  4:00 UTC (permalink / raw)



Steve VanDevender wrote:
> Has anyone successfully used the getprpwent()/putprpwent() routines to
> manipulate the auth.db database, or have other experience relevant to
> using or converting shadow passwd files to work under Digital UNIX?

I have used getprpwent() for things like ftp, pop, and imap servers that
need to authenticate clients against the Digital Unix Enhanced Security
authentication database.  I've not had any real difficulties with this
routine.  I don't recall if I've used putprwent(), but I definitely have 
*not* used it to *create* accounts.

For creating accounts, I wrote a perl script.  The core of the script
creates the (v3.x) protected password entry.  It would seem trivial 
for a reasonably accomplished perl programmer to modify it to clone
non-Digital 
password entries for use on a Digital Unix box.  However, there is no
guarantee 
that this approach doesn't compromise the integrity of the
authentication subsystem!
Below are two snippets of the code, the first for creating the
/etc/passwd entry,
and the second for creating the authentication database entry.  The
second snippet
needs to be revised slightly to support v4.x, where you must use
/tcb/bin/edauth 
to inject the new entry into the authentication database instead of
creating the 
file directly.  That is a trivial exercise in piped commands.

Regards,
Todd

printf PTMP
"$username:*:$new_uid:$new_gid:$fullname:$new_dir:$new_shell\n";

# Create the protected password entry
$first = substr($username,0,1);
$authfile = "/tcb/files/auth/$first/$username";
open(AUTH, ">/tcb/files/auth/$first/$username");
print AUTH "$username:u_name=$username:u_id#$new_uid:\\\n";
print AUTH "\t:u_pwd=$encrypted_password:\\\n";
print AUTH "\t:u_lock\@:\\\n";
print AUTH "\t:chkent:\n";
close(AUTH);
chown 6, 11, $authfile;         # TODO - get 'auth:auth' numbers from
files!
chmod(0660,$authfile);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: putting passwords in auth.db
  1996-10-09  4:00 ` Todd Aven
@ 1996-10-10  4:00   ` Randy M. Hayman
  0 siblings, 0 replies; 4+ messages in thread
From: Randy M. Hayman @ 1996-10-10  4:00 UTC (permalink / raw)




Steve VanDevender wrote:
> Has anyone successfully used the getprpwent()/putprpwent() routines to
> manipulate the auth.db database, or have other experience relevant to
> using or converting shadow passwd files to work under Digital UNIX?

There are multiple solutions (under v4.0[a]), two of which are:
(1) Look at the getespwent(3) man page carefully.  Unfortunately there
    isn't a man page for the copyespwent() function referenced in 
    getespwent(3).
(2) use convauth to convert auth.db to /tcb/files/auth/?/<account> files
    then use the getprpwent/putprpwent functions
    then use convauth to convert back to auth.db format.

-- 
Randy M. Hayman					haymanr@icefog.alaska.edu
	"Ethernet works in practice but not in theory" -- Bob Metcalfe



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-10-10  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-02  4:00 putting passwords in auth.db Steve VanDevender
1996-10-09  4:00 ` Steve VanDevender
1996-10-09  4:00 ` Todd Aven
1996-10-10  4:00   ` Randy M. Hayman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox