Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I can't login

Featured Replies

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

  • Author
8 hours ago, Squid said:

您是否尝试过重启?

yes

I even reset my root password

  • 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. 

Please reboot in safe-mode and see if issue persists.

btw: to reset passwords only delete:

config/shadow

config/smbpasswd

 

If you delete config/passwd you will need to recreate any users you added.

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.

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.

  • 1 month later...

So what do you recommend? I have the same problem...

 

EDIT: OK rebooting in safe mode and using "passwd" did the trick :P

thx

Edited by karoldo

  • 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.

  • 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

  • Community Expert

Have you tried clearing the cache in the browser?

1 hour ago, itimpi said:

Have you tried clearing the cache in the browser?

No difference, thanks for the advice anyway.

  • Community Expert
20 minutes ago, LucaV said:

No difference, thanks for the advice anyway.

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?

25 minutes ago, Squid said:

Set a password in the local GUI?

Yes i did setup a password in the local gui, but even before, when it was empty (the pw field), the same error was showing up.

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

  • Community Expert

You might try logging in with https://ip-address to see if that works?   If so it will narrow down the possibilities of what has been going wrong.

48 minutes ago, itimpi said:

You might try logging in with https://ip-address to see if that works?   If so it will narrow down the possibilities of what has been going wrong.

Yes with the ip address I am directly logged in, now i don't see the logout button

30 minutes ago, LucaV said:

now i don't see the logout button

Because there's no password set.  Try it again.

56 minutes ago, Squid said:

Because there's no password set.  Try it again.

there is a password set

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.