[comp.unix.questions] passwd file maint utilities - shadowing

aland@infmx.UUCP (Dr. Scump) (03/06/90)

Several questions related to the shadow passwd file (/etc/shadow):

1) which versions of UNIX use it by default?  With which version did
   shadowing begin - SVR2?  SVR3?  SVR3 Rel 3.2 ?  other?  Is it
   the same for AT&T and other System V vendors?

2) with those versions which use shadowing by default -- can it be
   turned "off" just by removing /etc/shadow and restoring passwords
   to /etc/passwd?

3) do shadowing UNIX versions all use the same utilities?  The only
   ones that I am familiar with are AT&T's (adduser, deluser, passmgmt).
   Do the other vendors use the same utility names and parameter usage?

4) also, is there a way to *set* a passwd from a script?  /bin/passwd
   seems to insist on interactive use.  I can remove a passwd (via
   /bin/passwd -d username) but not set one, as far as I can see.
   I checked everywhere in TFM that I can think of.

Thanks in advance.   Followups to comp.unix.questions.

--
Alan S. Denney # Informix # aland@informix.com # {pyramid|uunet}!infmx!aland
 CAUTION: Objects in terminal are closer than they appear...
 Disclaimer: These opinions are mine alone.  If I am caught or killed,
             the secretary will disavow any knowledge of my actions.

 "These tests will have no effect on your grades.  They will merely
  determine your future social status and financial success, if any."
  

pag@tcsc3b2.tcsc.com (Philip A. Gross) (03/09/90)

aland@infmx.UUCP (Dr. Scump) writes:

>Several questions related to the shadow passwd file (/etc/shadow):

>1) which versions of UNIX use it by default?  With which version did
>   shadowing begin - SVR2?  SVR3?  SVR3 Rel 3.2 ?  other?  Is it
>   the same for AT&T and other System V vendors?

SVR3.2

>2) with those versions which use shadowing by default -- can it be
>   turned "off" just by removing /etc/shadow and restoring passwords
>   to /etc/passwd?

yes

>3) do shadowing UNIX versions all use the same utilities?  The only
>   ones that I am familiar with are AT&T's (adduser, deluser, passmgmt).
>   Do the other vendors use the same utility names and parameter usage?

The passmgmt command under SVR3.2 takes care of both the passwd and
shadow files.  Until SVR3.2, I simply edited the /etc/passwd file to
perform the administration, but now that we are using the /etc/shadow
file as well, it is perhaps easier to use the passmgmt command then
it is to edit the two files.  As far as what other vendors use to
manage the /etc/passwd file, I am not sure.

>4) also, is there a way to *set* a passwd from a script?  /bin/passwd
>   seems to insist on interactive use.  I can remove a passwd (via
>   /bin/passwd -d username) but not set one, as far as I can see.
>   I checked everywhere in TFM that I can think of.

You are correct.  To the best of my knowledge, the /bin/passwd command
is the only tool available for setting user passwords and it requires
user interaction.  I suppose that if you could figure out what the
/bin/passwd command uses as its encryption key, you could write a 'C'
program to handle this need.

===============================================================================
Philip A. Gross       The Computer Solution Co., Inc.       Voice: 804-794-3491
-------------------------------------------------------------------------------
INTERNET:	pag@tcsc3b2.tcsc.com
USENET:		...!tcsc3b2!pag
UUCP:		tcsc3b2!pag	(804)794-1514
ATTMAIL:	attmail!tcsc3b2!pag
-------------------------------------------------------------------------------
        The opinions expressed here are strictly mine and nobody elses.
        << I haven't heard what I have to say about that yet. >> :-)
-- 
===============================================================================
Philip A. Gross       The Computer Solution Co., Inc.       Voice: 804-794-3491
-------------------------------------------------------------------------------
INTERNET:	pag@tcsc3b2.tcsc.com

nts0302@dsacg3.dsac.dla.mil (Bob Fisher) (03/12/90)

From article <1990Mar8.183921.666@tcsc3b2.tcsc.com>, by pag@tcsc3b2.tcsc.com (Philip A. Gross):
| aland@infmx.UUCP (Dr. Scump) writes:
| 
|>4) also, is there a way to *set* a passwd from a script?  /bin/passwd
|>   seems to insist on interactive use.  I can remove a passwd (via
|>   /bin/passwd -d username) but not set one, as far as I can see.
|>   I checked everywhere in TFM that I can think of.
| 
| You are correct.  To the best of my knowledge, the /bin/passwd command
| is the only tool available for setting user passwords and it requires
| user interaction.  I suppose that if you could figure out what the
| /bin/passwd command uses as its encryption key, you could write a 'C'
| program to handle this need.

On our BSD 4.3 system we have two functions to do this in C.  I would hope
that SystemV would have the same or similar.

	getpass(prompt) returns the in-the-clear password but takes care of
	no echo for the terminal.

	crypt(password, salt) receives the in-the-clear password and a
	salt value (based on some random value - process id, time, etc)
	and returns the encrypted value that can be inserted into the
	password file.

-- 
Bob Fisher
US Defense Logistics Agency Systems Automation Center
DSAC-TSX, Box 1605, Columbus, OH 43216-5002     614-238-9071 (AV 850-9071)
bfisher@dsac.dla.mil		osu-cis!dsacg1!bfisher