OpenVZ Forum


Home » General » Support » Asking about how to create / change password (functions)
Asking about how to create / change password [message #41446] Sat, 22 January 2011 11:25 Go to next message
SomeOne is currently offline  SomeOne
Messages: 1
Registered: January 2011
Junior Member
Hello,
how can my php dev make scritp can make client change the password or make os reload etc, using Openvz with out using control panel ?

Re: Asking about how to create / change password [message #42903 is a reply to message #41446] Wed, 15 June 2011 15:40 Go to previous messageGo to next message
imatwb is currently offline  imatwb
Messages: 11
Registered: June 2011
Junior Member
To set a root password for a container, run command: vzctl exec container_number passwd

You can embed that command into your php script. It's just a matter of correct syntax from there on.
Re: Asking about how to create / change password [message #42932 is a reply to message #41446] Mon, 20 June 2011 20:13 Go to previous message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
or you can use vzctl special option. keep in mind that vzctl exec requires that container is started, while --userpassw does not.

vzctl set [xxx] --userpasswd [username]:[password]
from the manual


--userpasswd user:password
           Sets password for the given user in a container, creating the user if it does not exists.  Note that this option is not  saved  in
           configuration  file  at  all  (so  --save  flag  is  useless),  it  is  applied to the container (by modifying its /etc/passwd and
           /etc/shadow files).

           In case container root filesystem is not mounted, it is automatically mounted, then all the appropriate file changes are  applied,
           then it is unmounted.

           Note that container should be created before using this option.
Previous Topic: vzdump snapshot: archive file size 10KB
Next Topic: 2.6.18-238.12.1.el5.028stab091.1: No filesystems with quota detected.
Goto Forum:
  


Current Time: Sat Oct 19 14:36:53 GMT 2024

Total time taken to generate the page: 0.08411 seconds