Re: Forcing password change for a user

1999-04-29 Thread Arcady Genkin
George Bonser [EMAIL PROTECTED] writes:

 man shadow

Thanks. I still have a question though. Example:

testdummy:mbjdfWfNf6Eto:10710:0:0:7:::

implies that the user's password expires after 0 days. But in practice 
this means that the user will have to change his password every day
(time?) he logs in.
This is not what I needed. I wanted to set a one-time password expiry
scheme, that would allow me to force a user change password _the first 
time_ he logs in.

Thanks for any input!
-- 
Arcady Genkin
I opened up my wallet, and it's full of blood... - GsYDE


Re: Forcing password change for a user

1999-04-29 Thread Oliver Elphick
Arcady Genkin wrote:
  Searched info on usermod and passswd and couldn't figure it out.
  
  How do I force a user to change password the next time he logs in?
  
 
If you are using shadow passwords (/etc/shadow exists) look at
`man 5 shadow', otherwise look at `man 5 passwd'.

-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
   PGP key from public servers; key ID 32B8FAA1
 
 And he said to them all, If any man will come after 
  me, let him deny himself, and take up his cross daily,
  and follow me.  Luke 9:23 



Re: Forcing password change for a user

1999-04-29 Thread Arcady Genkin
George Bonser [EMAIL PROTECTED] writes:

 When you create a user, touch a file in their directory called .newuser
 In the .bash_profile or .profile or .cshrc or whatever have the script
 check for the existance of this file. If found, it execs the passwd
 command and then delete the .newuser file.
 This has the advantage of allowing you to touch .newuser (and change the
 ownership so the user can delete it without complaint) at any time to
 force a password change ... or at least STRONGLY suggest a password
 change.

Thanks for your reply.
A little terminology query: by touch did you mean create? :)

I created .newuser file in a testdummy user's home directory. Then I
have added the following to ~/.bash_profile:

if test -e ~/.newuser; then
echo Change of password forced
/usr/bin/passwd
rm ~/.newuser
fi

(please bear with me, this is the first shell script I have ever
written :-/). This seems to do what I wanted, but I see a
complication - a user can  abort changing password by
pressing CNTRL-C (just tried it). How can I make *absolutely* sure
that the password gets changed the first time a user logs on?

I think I could make a loop in the script, exit condition of which
would be successful termination of passwd, right? But then, does
CNTRL-C terminate execution of the script or only of the current
command in the script?

Thanks for any input!
-- 
Arcady Genkin
I opened up my wallet, and it's full of blood... - GsYDE


Re: Forcing password change for a user

1999-04-29 Thread Arcady Genkin
George Bonser [EMAIL PROTECTED] writes:

Sorry to bug you again, but I am still looking for the password change 
solution...

The .bash_profile solution works, but then if the user changes his default
shell from bash to smth else, I won't be able to force password change 
anymore... Is there any file that gets called every time a user logs
in? Irrespective of which shell he is using? I could put there a call
for such a script, which would check for existance of .newuser file
etc...

Thanks!
-- 
Arcady Genkin
I opened up my wallet, and it's full of blood... - GsYDE


Re: Forcing password change for a user

1999-04-29 Thread Richard Harran
How about using 'chage'.  I think you probably need to play with the -M
and -d switches.  BTW chage is in the passwd package.

HTH
Rich 

Arcady Genkin wrote:
 
 George Bonser [EMAIL PROTECTED] writes:
 
 Sorry to bug you again, but I am still looking for the password change
 solution...
 
 The .bash_profile solution works, but then if the user changes his default
 shell from bash to smth else, I won't be able to force password change
 anymore... Is there any file that gets called every time a user logs
 in? Irrespective of which shell he is using? I could put there a call
 for such a script, which would check for existance of .newuser file
 etc...
 
 Thanks!
 --
 Arcady Genkin
 I opened up my wallet, and it's full of blood... - GsYDE
 
 --
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null