It is currently Sat, 24 Oct 2020 09:36:59 GMT



 
Author Message
 changing password via shell script
I'm looking for a way to change a password via a shell script.  My best
guess is that it should look something like this, only it should work
which this doesn't.
#!/usr/bin/sh
/usr/bin/passwd username <<+ password password+

Any help?

Mark

Sent via Deja.com
http://www.**-**.com/



 Sat, 07 Jun 2003 09:01:23 GMT   
 changing password via shell script
: I'm looking for a way to change a password via a shell script.  My best
: guess is that it should look something like this, only it should work
: which this doesn't.
: #!/usr/bin/sh
: /usr/bin/passwd username <<+ password password+

Mark,

I wrote a script (in perl...though I don't think that that matters...) which
asks for a user name, searches for that username in the /etc/passwd file,
zeroes out the password field, and then runs a 'passwd username' against it,
as root.  

This succeeds in allowing a root user to change the password of a username,
without *ever* having to know the previous one.

Don't know if that's any help or not...just my two cents. :-)

- Todd



 Thu, 12 Jun 2003 06:07:12 GMT   
 changing password via shell script

Huh? root has *never* needed to know the current value of a user's
password in order to change it. Otherwise, how could root change a
user's password if they have forgotten it? Your perl script does not
give root any new powers.



 Thu, 12 Jun 2003 08:16:00 GMT   
 
   [ 3 post ] 

Similar Threads

1. CGI script for changing passwords via WWW

2. Changing password via script

3. Changing UNIX pwd via c-shell script

4. Change user password using shell script

5. Changing User Passwords in Shell Script

6. Automated password change from within shell script.

7. Automated password change from within shell script.

8. flexible prompt in shells via shell-script


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software