X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=axlNB4QrtEiJ6WHV1lnMdGfP7JU/FqV1Zp3GlYsyzzr5+IWLGWv7b
	cOskYyZUssj9JQxb8QuMYN0hI75zLzR3X481GpI81FmE6D7RklUsV6vK8fzjerzv
	pCfx7hRZSWqlD8ZT9fDnd5XngpO8xm4CitpHOC0+7LbM08BOq68hdk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=919jJkq7xz/bYS65KfVmswdQAkI=; b=ubgC+EC81fTXDFw+IgiEguIv/VW2
	NfXXPkfu+Dl2gz2irnrmxAgrDltKvb7/VLqv7wv3/pNqvoDRv8SJ64XiuIPIDUNm
	Wsq56q4JcKX7JzfJiUKg6TLeh3CJE8o1NsiisAE9K3L1YrQkQ0/+jzieh6Peph0W
	EuDXH7Hfl+vmoMM=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Fri, 18 Apr 2014 13:17:22 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: passwd -R
Message-ID: <20140418111722.GB16638@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <OFA40FC8AD.438FBB46-ON65257CBE.001E57FE-65257CBE.001E5F4A@in.ibm.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="2fHTh5uZTiUOsy+g"
Content-Disposition: inline
In-Reply-To: <OFA40FC8AD.438FBB46-ON65257CBE.001E57FE-65257CBE.001E5F4A@in.ibm.com>
User-Agent: Mutt/1.5.21 (2010-09-15)

--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Apr 18 10:58, Vijay K Sukthankar wrote:
>=20
>=20
> Hi,
>=20
> 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
>=20
> 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

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--2fHTh5uZTiUOsy+g
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTUQnCAAoJEPU2Bp2uRE+gVjYP/1zeaqyHxIWUnRE1ni70viR2
ie+GnxbiwHfliOvhw8aJOd42YJsmsCYc8AeBOBZXxGRrPSsMsed2qq/ugsHXYIO/
Lq156G2rlGLw8mICbotV9JJXLcjONdzs5sGQhignHLRZlKdnExu+ls7DSZoaYnOB
xIDxU+i1Jh1edb+puVZYK8PK9psrGlu0fPeIVH4Q9PumAWQX2BhZ0s+huIvVl7gj
r98/vfc0f9ZXhcTikEEVq5XZJjaK542lVGfQ9LNhzBC7890NvibuQyE/Bkm8ki4X
3mx3C8EFmDaSZRxvNTKg8ZyuWKtdThfijVYg059oNARukCo7g9KJM4E4xSxtu4FS
sV86ECwkpIUoyvyqXSuKU0G3r4T+3u9T4OQ2gcWFOWPgUa1nxvvbJMa7s9Vp40YP
Yxe+YeIUUcnIz2AYarDvPs0gja3AkDFpOjy/5gVJCdUUBp4I+0m0ulXf1K6pbJ1N
Aazfa+ZoQNxBvDtAKnERJz71HuMwN+9ta3A6gdvOMQRRmRT4uC4lMtxv4kQ0OMNO
gpc1DkV4120ypQl+VMrWHHMIKG+E2sxeJL80tmuWlv5xBkeNBwNGjhZkXllCckKo
KhMzfo6lvhVYuH9Yc5LqDxzpT0/yd9v9GNuA8xtqMQDMD8lg4cdjQXSFvPBLCylW
Dq2DiMnqRccXu3bK13df
=sXJP
-----END PGP SIGNATURE-----

--2fHTh5uZTiUOsy+g--
