This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: passwd -R


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

Attachment: pgpIAv0gWEzEZ.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]