I can't login


QLSL

Recommended Posts

Warning: file(/etc/nginx/htpasswd): failed to open stream: No such file or directory in /usr/local/emhttp/login.php on line 23

Warning: Invalid argument supplied for foreach() in /usr/local/emhttp/login.php on line 23

 

 

I followed the instructions in the manual forgot my password, but it didn't work out

  Delete these files:

config/passwd

config/shadow

config/smbpasswd

Link to comment
  • 2 weeks later...
On 2/16/2020 at 11:18 AM, QLSL said:

Warning: file(/etc/nginx/htpasswd): failed to open stream: No such file or directory in /usr/local/emhttp/login.php on line 23

Warning: Invalid argument supplied for foreach() in /usr/local/emhttp/login.php on line 23

 

 

I followed the instructions in the manual forgot my password, but it didn't work out

  Delete these files:

config/passwd

config/shadow

config/smbpasswd

same issue deleted stated files and still get same error. 

Link to comment

You can backup and modify the login.php to

   // foreach (file('/etc/nginx/htpasswd') as $strCredentials) {
        //list($user,$pwhash) = explode(':', trim($strCredentials));

        // Validate credentials
        if ($_POST['username'] == 'YOURUSERNAME' && $_POST['password'] == 'YOURPASSWORD') {
            // Successful login, start session
            session_start();
            $_SESSION['unraid_login'] = time();
            $_SESSION['unraid_user'] = $_POST['username'];
            session_regenerate_id(true);
            session_write_close();
            exec("logger -t webGUI ".escapeshellarg("Successful login user {$_POST['username']} from {$_SERVER['RE
MOTE_ADDR']}"));
            header("Location: /".$var['START_PAGE']);
            exit;
        }
    //}

Then you login with YOURUSERNAME and YOURPASSWORD.

 

and in user page, you could change your password of your account , the program will recreate the /etc/nginx/htpasswd file.

last, you need to restore the backup login.php file.

Link to comment
15 hours ago, Darsy said:

You can backup and modify the login.php to


   // foreach (file('/etc/nginx/htpasswd') as $strCredentials) {
        //list($user,$pwhash) = explode(':', trim($strCredentials));

        // Validate credentials
        if ($_POST['username'] == 'YOURUSERNAME' && $_POST['password'] == 'YOURPASSWORD') {
            // Successful login, start session
            session_start();
            $_SESSION['unraid_login'] = time();
            $_SESSION['unraid_user'] = $_POST['username'];
            session_regenerate_id(true);
            session_write_close();
            exec("logger -t webGUI ".escapeshellarg("Successful login user {$_POST['username']} from {$_SERVER['RE
MOTE_ADDR']}"));
            header("Location: /".$var['START_PAGE']);
            exit;
        }
    //}

Then you login with YOURUSERNAME and YOURPASSWORD.

 

and in user page, you could change your password of your account , the program will recreate the /etc/nginx/htpasswd file.

last, you need to restore the backup login.php file.

I highly recommend not doing this.

  • Thanks 1
  • Haha 1
Link to comment
  • 1 month later...
  • 1 year later...

I had this same problem and error message, it started after resetting my password by deleting the files specified in the Troubleshooting article: https://wiki.unraid.net/Manual/Troubleshooting#Restoring_your_Docker_Applications

 

Turns out, after doing that, do NOT go to http://your_unraid/login and try and log in, that will give you the error `Warning: file(/etc/nginx/htpasswd): failed to open stream: No such file or directory in /usr/local/emhttp/login.php on line 85`

 

Instead you must just go to http://your_unraid/ with no path, and you will be logged in as root.

 

God I nearly had to re-do the entire thing because of this (including my Home Assistant, pi-hole, and Unifi configs), thank goodness I bumbled into the solution. I hope this helps someone else with the same issue.

Link to comment
  • 2 months later...

Hello, as for the user guide, i deleted: 

 

config/passwd

config/shadow

config/smbpasswd

 

Now I can login using the monitor physically connected to the server ad all seems working fine.

 

I have a problem though, if i try to login using a browser this errors show up:


Warning: file(/etc/nginx/htpasswd): failed to open stream: No such file or directory in /usr/local/emhttp/login.php on line 85

Warning: Invalid argument supplied for foreach() in /usr/local/emhttp/login.php on line 85

 

How can i regain remote access to the server?

 

Thanks in advance.

 

Luca

Link to comment
27 minutes ago, itimpi said:

Very strange then.   In both local and remote access you are using a browser.   Are you trying to connect via server name or IP address - maybe trying the other might help?

neither, i am logging in with the link that it's created when you activate https

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.