Current time: 11-25-2024, 06:34 AM Hello There, Guest! (LoginRegister)


Post Reply 
change the mysql user and password
Author Message
graywolf Offline
Junior Member
*

Posts: 43
Joined: Sep 2007
Reputation: 1
Post: #1
change the mysql user and password
i want to alter the user and pasword in ispcp.conf for the database connection i see that the php code calls a decrypt password

is there a tool to gen a new password or do i need to write my own
10-25-2007 08:54 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: change the mysql user and password
first read the FAQ
http://www.isp-control.net/ispcp/wiki/howto_dbchangepw

/J
10-25-2007 09:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
graywolf Offline
Junior Member
*

Posts: 43
Joined: Sep 2007
Reputation: 1
Post: #3
RE: change the mysql user and password
nvm i wrote a quick and nasty tool

ill post it here in a few
10-25-2007 09:16 AM
Find all posts by this user Quote this message in a reply
graywolf Offline
Junior Member
*

Posts: 43
Joined: Sep 2007
Reputation: 1
Post: #4
RE: change the mysql user and password
/var/www/ispcp/engine/ispcp-passwdgen
Code:
#!/usr/bin/perl

# ispCP  (OMEGA) a Virtual Hosting Control Panel
# Copyright (c) 2001-2006 by moleSoftware GmbH
# http://www.molesoftware.com
# Copyright (c) 2006-2007 by isp Control Panel
# http://isp-control.net
#
#
# License:
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the MPL Mozilla Public License
#    as published by the Free Software Foundation; either version 1.1
#    of the License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    MPL Mozilla Public License for more details.
#
#    You may have received a copy of the MPL Mozilla Public License
#    along with this program.
#
#    An on-line copy of the MPL Mozilla Public License can be found
#    http://www.mozilla.org/MPL/MPL-1.1.html
#
#
# The ispCP  Home Page is at:
#
#    http://isp-control.net
#

use FindBin;

use lib "$FindBin::Bin/..";
require 'ispcp_common_code.pl';

use strict;
use warnings;
use Socket;

%main::ua = ();

################################################################################​
##                                SUBROUTINES                                 ##
################################################################################​

sub welcome_note {

    my ($rs, $rdata) = (undef, undef);

    push_el(\@main::el, 'welcome_note()', 'Starting...');

    my $welcome_message = <<MSG;

    Welcome to ispCP '$main::cfg{'Version'}' Password Gen.
    This program will gen a password for ispCP OMEGA system.
MSG

    print STDOUT $welcome_message;

    push_el(\@main::el, 'welcome_note()', 'Ending...');

    return 0;

}


sub ask_db_password {

    my ($rs, $pass1, $pass2) = (undef, undef, undef);

    push_el(\@main::el, 'ask_db_password()', 'Starting...');

    my $db_password = 'none';

    my $qmsg = "\n    Please enter system SQL password. [$db_password]: ";

    $pass1 = read_password($qmsg);

    if (!defined($pass1) || $pass1 eq '') {

        $main::ua{'db_password'} = '';

    } else {

        $qmsg = "    Please repeat system SQL password: ";

        $pass2 = read_password($qmsg);

        if ($pass1 eq $pass2) {

            $main::ua{'db_password'} = $pass1;

        } else {
            print STDOUT "\n    Passwords do not match!";
            return 1;

        }

    }

    push_el(\@main::el, 'ask_db_password()', 'Ending...');
    
    my $encryptedpass=encrypt_db_password($main::ua{'db_password'});

    print STDOUT "    Password:\n    $pass1\n    Encrypted:\n    $encryptedpass\n\n";
    return 0;

}


sub user_dialog {

    my $rs = undef;

    push_el(\@main::el, 'user_dialog()', 'Starting...');

    $rs = welcome_note();

    return $rs if ($rs != 0);


    do {

        $rs = ask_db_password();

    } while ($rs == 1);

    push_el(\@main::el, 'user_dialog()', "db_password: $main::ua{'db_password'}");
    push_el(\@main::el, 'user_dialog()', 'Ending...');

    return 0;

}


################################################################################​
##                                  MAIN                                      ##
################################################################################​

my $rs = undef;


$rs = user_dialog();

if ($rs != 0) {

    my $el_data = pop_el(\@main::el);

    my ($sub_name, $msg) = split(/$main::el_sep/, $el_data);

    print STDERR "$msg\n";

    exit 1;

}


if ($rs != 0) {

    my $el_data = pop_el(\@main::el);

    my ($sub_name, $msg) = split(/$main::el_sep/, $el_data);

    print STDERR "$msg\n";

    exit 1;

}
10-25-2007 09:21 AM
Find all posts by this user Quote this message in a reply
graywolf Offline
Junior Member
*

Posts: 43
Joined: Sep 2007
Reputation: 1
Post: #5
RE: change the mysql user and password
lol

read doc's who do you think i am......

anyways thanks sorry about ust trying to get about 10 things done at once
10-25-2007 09:36 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: change the mysql user and password
But you know

/var/www/ispcp/engine/ispcp-db-passwd

do you?
10-25-2007 09:45 AM
Visit this user's website Find all posts by this user Quote this message in a reply
graywolf Offline
Junior Member
*

Posts: 43
Joined: Sep 2007
Reputation: 1
Post: #7
RE: change the mysql user and password
yeah i saw it after i rushed into cut'n'paste coding the above code
10-25-2007 09:54 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)