Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: Changing user password remotely using SSH script

Subject: Re: Changing user password remotely using SSH script
Date: Wed, 18 Aug 2004 13:15:12 +0300 (EEST)
On Mon, 16 Aug 2004, +ACI-Nguyen, David M+ACI- wrote:

Date: Mon, 16 Aug 2004 13:00:00 -0400
From: "+ACI-Nguyen, David M+ACI-" <david.m.nguyen@xo.com>
To: secureshell@securityfocus.com
Subject: Changing user password remotely using SSH script

I need to reset hundreds of user passwords remotely.  Has someone done this 
using SSH script?  Can I have a sample code?

Thanks,
David 



Hi,

try something like this:
ssh root@host 'while read user; do echo default_pass | passwd --stdin ${user}; 
done </path/userlist'

...or:
ssh root@host 'while read user; do echo default_pass | passwd --stdin ${user}; 
done' </path/userlist
if the user list is in a local file.


-- 
Catalin Petrescu <taz dntis ro>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/CC/IT/S/MU d- s+: a- C++ ULAS++++$ P+>+++ L+++ E- W+ N+ o? K?
w-- O-- M- V? PS+ PE Y PGP+>++ t 5? X+ R? tv--@ b+>++ DI++ D+ G
e++++ h++(---) r+++ y?
------END GEEK CODE BLOCK------

<Prev in Thread] Current Thread [Next in Thread>