February 16, 20206 yr 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
February 29, 20206 yr 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.
March 2, 20206 yr 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.
March 6, 20206 yr 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.
March 6, 20206 yr 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.
May 4, 20206 yr So what do you recommend? I have the same problem... EDIT: OK rebooting in safe mode and using "passwd" did the trick thx Edited May 4, 20206 yr by karoldo
October 13, 20214 yr 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.
December 30, 20214 yr 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
December 30, 20214 yr 1 hour ago, itimpi said: Have you tried clearing the cache in the browser? No difference, thanks for the advice anyway.
December 30, 20214 yr 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?
December 30, 20214 yr 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.
December 30, 20214 yr 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
December 30, 20214 yr 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.
December 30, 20214 yr 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
December 30, 20214 yr 30 minutes ago, LucaV said: now i don't see the logout button Because there's no password set. Try it again.
December 30, 20214 yr 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.