Attached is a patch which passes the password to the postcreate script:

 

VE_ROOTPASSWD .. plain text passwd

VE_CROOTPASSWD .. crypted  passwd (md5)

 

postcreate script can then modify /etc/passwd and /etc/shadow.

 

what do you think?

 

- Dietmar

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dietmar Maurer
Sent: Donnerstag, 06. November 2008 10:51
To: users@openvz.org
Subject: [Users] create CT with password

 

Hi all,

 

currently you need to use the following command to change the password
inside a CT:

 

vzctl set CTID --userpasswd root:XXX

 

This starts/stop the CT if it is not already running.

 

That is OK unless you have preconfigured appliance templates which does
some

initialization at first startup. Let me explain:

 

1.)    User create the CT: vzctl creat 777 --ostemplate name ...

2.)    User set the password: vzctl set 777 --userpasswd root:XXX
(start/stop CT)

3.)    User starts the CT

 

As you see, there is a totally unnecessary start/stop action. Even
worse, the container

is not fully functional at that time because HOSTNAME, DOMAIN,... in not
set before the

container is started with "vzctl start".

 

I wonder if it would be possible to add a  --userpasswd parameter to the
'create' command? Or maybe

only a --rootpasswd option (because root is always a local user).

 

/etc/passwd and /etc/shadow should be easy to modify directly, or are
there some distributions

with unusual file formats?

 

- Dietmar

 

 

 

Attachment: pwhack.diff
Description: pwhack.diff

_______________________________________________
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users

Reply via email to