Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #11  
Old 7th December 2011, 22:35
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default

When till said,

Quote:
ISPConfig uses the Linux default algorithm which is crypt-md5
I believe he was referring to the algorithm that ISPConfig uses when creating Linux system users (not ISPConfig users, per se).

How are you creating your new users? With the ISPConfig API?
Reply With Quote
Sponsored Links
  #12  
Old 8th December 2011, 08:36
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

Quote:
I believe he was referring to the algorithm that ISPConfig uses when creating Linux system users (not ISPConfig users, per se).
The algorithm is used for all passwords in ISPConfig (Linux System Users ISPConfig CP Users and Email accounts) except of mysql logins as mysql uses its own algorithm.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #13  
Old 8th December 2011, 12:02
Typhon Typhon is offline
Member
 
Join Date: Dec 2011
Posts: 78
Thanks: 27
Thanked 4 Times in 3 Posts
Default

Quote:
How are you creating your new users? With the ISPConfig API
I insert user with PDO :
Quote:
Originally Posted by Typhon View Post
I did not understand, I do not know the key-based logins and password-based SSH logins
I have an other problem, i try to add a user
PHP Code:
        $username $_POST['username'];
        
$password crypt($_POST['password']);
        
        
$query=$db->prepare('INSERT INTO  client(username, password)
        VALUES (:username, :password)'
);
        
$query->bindValue(':username'$usernamePDO::PARAM_STR);
        
$query->bindValue(':password'$passwordPDO::PARAM_STR);
        if(
$query->execute()){echo 'yes';}
        
$query->CloseCursor(); 
The user is created in the DB but i can't use it for connection, i have this message when i try to login in ISPC :
ERROR

Error
Username or Password wrong.
I think that there are a problem with the password hashing, we must use cryt, no ?

EDIT :Even if i change the password from my admin account i cannot connect….
For information, i have give in the DB ONLY the username and the password
Reply With Quote
  #14  
Old 8th December 2011, 12:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,977
Thanks: 825
Thanked 5,369 Times in 4,216 Posts
Default

Quote:
$password = crypt($_POST['password']);
Thats not crypt-md5 encryption. Crypt can create many different algorithms, see php manual. Take a look here on how to create a crypt-md5 password.

Code:
function crypt_password($cleartext_password) {
		$salt="$1$";
		$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
		for ($n=0;$n<8;$n++) {
			$salt.=$base64_alphabet[mt_rand(0,63)];
		}
		$salt.="$";
		return crypt($cleartext_password,$salt);
	}
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Typhon (8th December 2011)
  #15  
Old 8th December 2011, 21:00
Typhon Typhon is offline
Member
 
Join Date: Dec 2011
Posts: 78
Thanks: 27
Thanked 4 Times in 3 Posts
Default

Quote:
Originally Posted by till View Post
Thats not crypt-md5 encryption. Crypt can create many different algorithms, see php manual. Take a look here on how to create a crypt-md5 password.

Code:
function crypt_password($cleartext_password) {
		$salt="$1$";
		$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
		for ($n=0;$n<8;$n++) {
			$salt.=$base64_alphabet[mt_rand(0,63)];
		}
		$salt.="$";
		return crypt($cleartext_password,$salt);
	}
It's difficult to imagine the system that ISPC use so it's impossible for me to create a user ?
There are no developers in this forum ?
Can some body give me the function that ISPC use ?
Reply With Quote
  #16  
Old 8th December 2011, 21:10
Typhon Typhon is offline
Member
 
Join Date: Dec 2011
Posts: 78
Thanks: 27
Thanked 4 Times in 3 Posts
Default

Quote:
Originally Posted by till View Post
Thats not crypt-md5 encryption. Crypt can create many different algorithms, see php manual. Take a look here on how to create a crypt-md5 password.

Code:
function crypt_password($cleartext_password) {
		$salt="$1$";
		$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
		for ($n=0;$n<8;$n++) {
			$salt.=$base64_alphabet[mt_rand(0,63)];
		}
		$salt.="$";
		return crypt($cleartext_password,$salt);
	}
It's difficult to imagine the system that ISPC use so it's impossible for me to create a user ?
There are no developers in this forum ?
Can some body give me the function that ISPC use ?
Reply With Quote
  #17  
Old 8th December 2011, 23:33
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
Default

Dude, you haven't told us anything about what you're attempting to do relative to "creating a user" or where you're doing it. Are you modifying the ISPConfig code? Are you attempting to create your own plug-in/module? It's hard for us to help when you're so vague.

Till built ISPConfig; he's qualified to address your questions. He also gave you a code-snippet that is copy-paste-ready and demonstrates the procedure for creating a password with the crypt-md5 algorithm.

Also, you do realize that the entire ISPConfig code-base is available to the public, right?

Perhaps checkout a copy of the SVN repository contents and dig-around...

Finally, ISPConfig has a complete API for doing things like creating new users. The newest version is very well-documented. Research it.
Reply With Quote
  #18  
Old 9th December 2011, 01:30
Typhon Typhon is offline
Member
 
Join Date: Dec 2011
Posts: 78
Thanks: 27
Thanked 4 Times in 3 Posts
Default

Quote:
Dude, you haven't told us anything about what you're attempting to do relative to "creating a user" or where you're doing it. Are you modifying the ISPConfig code? Are you attempting to create your own plug-in/module? It's hard for us to help when you're so vague.
No, i have created a DB user who have access to ISPC database, i create a query who permit me to add client, the complete page :

PHP Code:
<?php
// PDO con….

function crypt_password($cleartext_password) {
        
$salt="$1$";
        
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
        for (
$n=0;$n<8;$n++) {
            
$salt.=$base64_alphabet[mt_rand(0,63)];
        }
        
$salt.="$";
        return 
crypt($cleartext_password,$salt);
    }
if(isset(
$_POST['flag']))
{

        
$username $_POST['username'];
        
$password crypt_password($_POST['password']);
        
        
$query=$db->prepare('INSERT INTO  client(username, password)
        VALUES (:username, :password)'
);
        
$query->bindValue(':username'$usernamePDO::PARAM_STR);
        
$query->bindValue(':password'$passwordPDO::PARAM_STR);
        if(
$query->execute()){echo 'yes';}
        
$query->CloseCursor();
}
else
{
?>

        <h6 class="commentsTitle"><span>Add client</span></h6>
        <form class="addComment" action="" method="post">
            <input type="text" name="username" class="" value="client..." title="client..." />
            <input type="password" name="password" title="password..." />
            <input type="submit" name="flag" class="submit" value="Add !" />
        </form>
        </div>
<?php
}
?>
Quote:
Till built ISPConfig; he's qualified to address your questions. He also gave you a code-snippet that is copy-paste-ready and demonstrates the procedure for creating a password with the crypt-md5 algorithm.
yeah i know but it's doesn't work, Im don't qualified
Quote:
Also, you do realize that the entire ISPConfig code-base is available to the public, right
That's why i choose it ;o)

Quote:
Finally, ISPConfig has a complete API for doing things like creating new users. The newest version is very well-documented. Research it.
For the moment, the API can create only FTP users…but not client ?
Thank you very much Till and cbj4074

Last edited by Typhon; 9th December 2011 at 01:34.
Reply With Quote
  #19  
Old 10th December 2011, 13:03
Typhon Typhon is offline
Member
 
Join Date: Dec 2011
Posts: 78
Thanks: 27
Thanked 4 Times in 3 Posts
Default

Can some body help me, please
Reply With Quote
  #20  
Old 13th December 2011, 17:50
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 392
Thanks: 29
Thanked 58 Times in 50 Posts
 
Default

Quote:
That's why i choose it ;o)
Then you may as well read the code!

The Remoting Client API does indeed support creating, editing, and deleting clients. See the following file in the source:

Code:
/remoting_client/API-docs/client_add.html
If you insist on reinventing the wheel, see the following source files for examples of everything you could possibly need:

Code:
/interface/web/login/index.php
/interface/web/login/password_reset.php
/interface/web/client/client_edit.php
/interface/lib/classes/auth.inc.php
/interface/lib/classes/remoting_lib.inc.php
We've given you everything you need here.
Reply With Quote
The Following 2 Users Say Thank You to cbj4074 For This Useful Post:
till (13th December 2011), Typhon (13th December 2011)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
For questions or problems please contact the support. edge General 3 30th March 2009 13:51
Master Master replication questions and problems marchost HOWTO-Related Questions 5 4th October 2008 13:50
Problems and Questions Krrose27 Installation/Configuration 10 15th November 2007 12:37
Multiple ISPConfig & DNS Questions and Problems bfriend Installation/Configuration 3 6th January 2007 06:14
Users and websites aren't created Glorfindel Installation/Configuration 9 23rd February 2006 04:20


All times are GMT +2. The time now is 09:53.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.