passwd -R

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Apr 18 11:17:00 GMT 2014


On Apr 18 10:58, Vijay K Sukthankar wrote:
> 
> 
> Hi,
> 
> I am trying to decipher how to do some of commands on a cygwin shell
> remotely. I am using a Jython script to reset the Admin password and I
> understand that I would have to do the following
> 
> 1) change the password registry entry using passwd -R

Hang on.  You only need to do this if you use the account for login
purposes where you don't want to give your password, according to
http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview

> 2) net user Administrator <new password>

Otherwise this command or just using the Cygwin passwd command without
the -R option is sufficient:

  http://cygwin.com/cygwin-ug-net/using-utils.html#passwd

> When the command is executed it expects that a re-enter of password which I
> dont want. Is there a way I can do echo passwd | passwd -R which would
> change the password in registry.

That's not provided for.  You could try to give the password twice

  echo -e "${pwd}\n${pwd" | passwd

but no guarantee that it works.  Alternativly you write a tiny tool
which calls the Win32 function NetUserChangePassword:

  http://msdn.microsoft.com/en-us/library/bb706725.aspx


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140418/f55733c5/attachment.sig>


More information about the Cygwin mailing list