After update Debian Lenny to Squeeze cannot login

All languages are allowed, guests are free to write and create topics

After update Debian Lenny to Squeeze cannot login

Postby RickAr » Wed Apr 07, 2010 4:55 am

Hi Daniel,
We update to Debian Lenny (Stable) to Squeeze (testing) and now when we want to access Webhtb page (https://server/webhtb/) to enter the password "root" says: "By SH authentication failed, incorrect password or failed SSH connection "...
Before this update Webhtb works perfectly ...
How to reinstall Webhtb on Squeeze without losing the settings for classes, etc etc .... ??
Regards
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby RickAr » Wed Apr 07, 2010 5:04 am

Add that Squeeze run kernel 2.6.32.3
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby daniel » Wed Apr 07, 2010 11:40 am

man, here are two rules:
1. ssh open on port 22 and accept connections to 127.0.0.1 (if you want another port you must change something)
2. SELinux down

in last debian did you use php-pecl-ssh2?
do you have password set to root user?
if no: sudo passwd root


good luck
daniel
Site Admin
 
Posts: 68
Joined: Wed Nov 04, 2009 11:40 am
Location: Medgidia, Constanta, Romania

Re: After update Debian Lenny to Squeeze cannot login

Postby RickAr » Wed Apr 07, 2010 5:42 pm

Now, how do I change the port and ip address to webhtb ssh access?´
SElinux is disable
Have password root set
php-pecl-ssh2... dont remember, later I see...
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby RickAr » Wed Apr 07, 2010 5:46 pm

php-pecl-ssh2 : NO

(uncle, could you enable post edition on board?? :lol: :D )
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby daniel » Wed Apr 07, 2010 8:08 pm

latest auth.php should be like:

<?php
error_reporting(0);
include_once("config/config.php");
include_once("config/conectare.php");
$AuthPW = str_replace("``", "&", $_GET[AuthPW]);
include_once("Net/SSH2.php");
$ssh = new Net_SSH2('127.0.0.1');
if(!$ssh->login('root', $AuthPW)){
if (function_exists('ssh2_connect')) {
$connection = ssh2_connect('127.0.0.1', 22);
if(!ssh2_auth_password($connection, 'root', $AuthPW)){
@mysql_close();
exit('0');
}
}else{
@mysql_close();
exit('0');
}
}
print base64_encode($AuthPW);
@mysql_close();
?>


WebHTB PRO will have only this:

<?php
error_reporting(0);
include_once("config/config.php");
include_once("config/conectare.php");
$AuthPW = $_POST[AuthPW];
include_once("Net/SSH2.php");
$ssh = new Net_SSH2("127.0.0.1", $ssh2_port);
if(!$ssh->login('root', $AuthPW)){
@mysql_close();
exit('0');
}
print base64_encode($AuthPW);
@mysql_close();
?>

SO MAJOR CHANGES ARE:

php-pecl-ssh2 removed as alternative auth method and keeped only phpseclib, so even in 2.9 version, and work with method post because get may be logend in apache log files; when you want change the port if your ssh server is not running on 22:

$ssh = new Net_SSH2("127.0.0.1", $ssh2_port);

so, in 2.9 change port 22 ao create somewhere one var vamed $ssh2_port; example: $ssh2_port = 2222;

also search in apply_changes.php

best regards
daniel
Site Admin
 
Posts: 68
Joined: Wed Nov 04, 2009 11:40 am
Location: Medgidia, Constanta, Romania

Re: After update Debian Lenny to Squeeze cannot login

Postby RickAr » Thu Apr 08, 2010 6:40 am

Thanks Daniel...
The whole auth.php file are with the same settings that you tell me...

Then... How can I reinstall Webhtb WITHOUT lost current settings (ethx, class, etc etc)???

Regards
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby daniel » Thu Apr 08, 2010 9:53 am

export into an .sql file entire webhtb mysql database with phpmyadmin for example and keep somewhere webhtb directory
daniel
Site Admin
 
Posts: 68
Joined: Wed Nov 04, 2009 11:40 am
Location: Medgidia, Constanta, Romania

Re: After update Debian Lenny to Squeeze cannot login

Postby RickAr » Thu Apr 08, 2010 6:03 pm

I exported with mysqldump the webhtb db to file "webhtb.sql"... and now?
How rescue the data after I install new webhtb, f.ex. on dir /var/www/webhtb??

Regards
RickAr
 
Posts: 13
Joined: Thu Feb 25, 2010 5:48 pm

Re: After update Debian Lenny to Squeeze cannot login

Postby daniel » Fri Apr 09, 2010 6:02 am

:lol: create database webhtb
mysql -u root -p < webhtb.sql webhtb
edit config.php and use root if you don`t have another mysql user with all rights to webhtb database
daniel
Site Admin
 
Posts: 68
Joined: Wed Nov 04, 2009 11:40 am
Location: Medgidia, Constanta, Romania

Next

Return to WebHTB

Who is online

Users browsing this forum: No registered users and 1 guest

cron