The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What script changes password?

Discussion in 'General Discussion' started by bert, Sep 21, 2002.

  1. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Nick or anyone, we are writing a script that will reset the users password, but we have tried doing this with /scripts/chpass and even though it works, it does not change the password for FTP or FrontPage. What other scripts do we have to execute in order for those changes to take place?

    Your help is appreciated !
     
  2. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Just found out the /scripts/ftpupdate will syncronize the FTP password to the new user password, but still have not found the way to change the FrontPage password.

    Can any one assist?
     
  3. masood

    masood Well-Known Member

    Joined:
    Jun 14, 2002
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Any update on this? :p
     
  4. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    No update. No one told me anything :-(

    I managed to write the script though using /scripts/chpass to change the user's password, using /scripts/ftpupdate to synchronize the new password with FTP and then I wrote a little script that changes the frontpage password if it finds frontpage extensions enabled for the account. All it does is grabs the entry for the user from /etc/shadow and copies it to /home/user/public_html/_vti_pvt/service.pwd.
     
  5. newfield

    newfield Active Member

    Joined:
    Mar 2, 2002
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    State of Confusion
    use cpanel

    whatsamatter with the &change password& button in cpanel5?
    Seems to do everything you're asking?
    Am I missing sumthin' here? :p
     
  6. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Yes you are missing the point here :P

    The script we are writing is used to retrieve a user's lost password. The user fills out a form at our website and enters his email and domain, then the script basically goes through a Modernbill database, looks up the email for the user, matches the email to the domain, finds the server hostname where the domain is, connects to that server and stores some variables in a remote mysql database. The target server then executes the script(s) we are looking for to change the user's password and sends the new password to the user via email. :)
     
  7. SoftmegUK

    SoftmegUK Well-Known Member

    Joined:
    Feb 13, 2002
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    You could always get the script to login into WHM and change the password, it may b insecure but with a few additions you could make this script more secure.

    E.g in PHP:

    &?php
    $new_pass = &newpass&; // New Password For User
    $user = &username&; // Username

    $socket = fsockopen($conf_domain,2086);
    $authstr = &USER:PASS&;
    $pass = base64_encode($authstr);
    $in = &GET /scripts/passwd?password=$new_pass&user=$USER\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n&;
    $fput1 = fputs($socket,$in);

    fclose($socket);

    ?&


    Hope this helps!
     
  8. bert

    bert Well-Known Member

    Joined:
    Aug 21, 2001
    Messages:
    602
    Likes Received:
    0
    Trophy Points:
    16
    Thanks SoftmegUK. I appreciate that !

    I will give it a try.
     
Loading...

Share This Page