Menu

#33 "Incorrect id/password. If you forgot your password, please send an email"

open
nobody
None
2022-04-10
2015-02-01
Chris
No

Hello all,

I get "Incorrect id/password. If you forgot your password, please send an email" after running the installer.php (after I input the credentials) and cannot figure out what I did wrong. Btw, Iuse version nfsight-beta-20140905.tgz

So, what did I do:

  • I ran the installer.php after creating every files/directory, no problem: mysql with root, no complain at the end, tables have been created. (Of course I edited the configs, restarted nfsgiht by hand, no complains there)
  • Next one logging in: wrong ID it said, so I deleted the config.php, rerun the installer.php (several times), give me "test" "test" for user and password, no success. I even changed from "Ubuntu 14.04" and did the setup on a Centos 7, but still same problem, login ID wrong it said.
  • So I looked at the database: "use nfsight;" "show tables;"
    the tables: aggregation_log, alert, config, log, nfids, preferred_subnet, server_discovery ... , user, whitelist. So that one looks ok.
  • Next step: "select * from user;" gives "Empty set"

===> So, there was no login user created by the installer.php? This seems to be the actual problem on my box. Why didn´t the installer.php create the user itself but the tables? <===

Of course I created a user within mysql database:

uses nfsight;
INSERT INTO user (username, password, level) VALUES ('nfsight', 'nfsight', '1');

(and the user is shown within the table afterwards)

I rebooted the box and still "Incorrect id/password. If you forgot your password, please send an email"

For mysql I used:

CREATE DATABASE nfsight;
GRANT ALL PRIVILEGES ON nfsight. TO 'nfsight'@'%' IDENTIFIED BY 'nfsight';
GRANT ALL PRIVILEGES ON nfsight.
TO 'nfsight'@'localhost' IDENTIFIED
BY 'nfsight';
GRANT ALL PRIVILEGES ON nfsight.* TO 'nfsight'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit;

I rerun http:///mydomain.com/nfsen/nfsight/installer.php with "nfsight" for admin and "nfsight" for password. (I use "nfsight" everywhere, for the mysql user/password and the nfsight admin user/password. Of course that is not the same thing)

At the end of installer.php it tells me the same thing as before:

Successfully connected to the MySQL database
Table aggregation_log successfully created
Table log successfully created
Table config successfully created
Table server_discovery_day successfully created
Table server_discovery successfully created
Table whitelist successfully created
Table alert successfully created
Table nfids successfully created
Table preferred_subnet successfully created
Table server_discovery_hour successfully created
Table user successfully created

I edited /data/nfsen/etc/nfsen.conf, stopped and started nfsen. When I enter http:///mydomain.com/nfsen/nfsight/index.php and put in the credentials it still tells me:

"Incorrect id/password. If you forgot your password, please send an email"

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nfsight |
| performance_schema |
+--------------------+
4 rows in set (0,00 sec)

mysql> use nfsight;
Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------------+
| Tables_in_nfsight |
+-----------------------+
| aggregation_log |
| alert |
| config |
| log |
| nfids |
| preferred_subnet |
| server_discovery |
| server_discovery_day |
| server_discovery_hour |
| user |
| whitelist |
+-----------------------+
11 rows in set (0,01 sec)

mysql> select * from user;
Empty set (0,00 sec)

mysql>

I did all of above steps several times, but still something is going wrong. I know it´s probably not a bug, but perhaps someone already had that problem...
Regards,
Chris

Discussion

  • Anonymous

    Anonymous - 2015-02-04

    I am having the exact same problem as Chris. And have tried everything has has.

    Thanks, Scott

     
    • Anonymous

      Anonymous - 2022-03-03
      Post awaiting moderation.
  • Dan

    Dan - 2015-02-06

    I started installing today and had this problem as well. Tailing /var/log/httpd/error_log showed:

    [Fri Feb 06 11:10:19 2015] [error] [client <local IP>] PHP Notice:  Undefined offset: 0 in /var/www/nfsen/nfsight/function.php on line 139, referer: http://<server IP>/nfsen/nfsight/index.php
    

    I looked in /var/www/nfsen/nfsight/installer.php to find the line that adds a user into the database:

    ...

    $level= 1;
    

    ...

    "INSERT INTO user (username, password, level) VALUES ('".$user."', '".$pass."', '".$level."')";
    

    I then entered the nfsight database and inserted the following into "user":

    INSERT INTO user (username, password, level) VALUES ('nfadmin', 'nfadmin', '1');
    

    This still didn't work for me. I then looked in /var/www/nfsen/nfsight/function.php at line 139. I commented out some lines in the "authenticate" function, as shown below. This will remove the authentication page.

    $sql = "SELECT count(*) as total, last_connect FROM user WHERE username = '".$user."' and password = '".$pass."' group by last_connect LIMIT 1";
    $result = sql($sql);
    //        if ($result[0]['total'] == 1) {
    //$_SESSION['login'] = sha1($id.time().rand());
    $_SESSION['login'] = $user;
    $_SESSION['last_connect'] = $result[0]['last_connect'];
    $config->last_connect = $result[0]['last_connect'];
    $sql = "UPDATE user SET last_connect = NOW(), count_connect = count_connect + 1, ip_connect = '".$_SERVER['REMOTE_ADDR']."' WHERE username = '".$user."' LIMIT 1";
    sql($sql);
    nflog('authenticate', 'Last connect: '.$config->last_connect, 0, $user);
    

    ...

    //      } else {
    //              nflog('authenticate', $_SERVER['REMOTE_ADDR'], -1, $user); 
    //      }
    

    Disclaimer: This will remove the authentication page. I don't know much of anything about php or mysql. This is not a good solution, but it solves my immediate problem of not being able to log in. Also, make sure you have backups of your files before editing them.

    I'll revisit this later. Let me know if this helps or if you find a proper fix.

     

    Last edit: Dan 2015-02-06
  • Anonymous

    Anonymous - 2015-02-12

    password must be sha1 in the db ! so you will encrypt sha1 and copy in db . good luck

     
  • Anonymous

    Anonymous - 2015-03-25

    echo -n "password" | shasum
    5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 -

    and then:

    INSERT INTO user (username, password, level) VALUES ('nfsight', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', '1');

     
  • Anonymous

    Anonymous - 2015-03-25

    ]# echo -n password | sha1sum | awk '{print $1}'
    5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8

    mysql> INSERT INTO user (username, password, level) VALUES ('nfsight', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', '1');

     

Anonymous
Anonymous

Add attachments
Cancel