QLSL Posted February 16, 2020 Share Posted February 16, 2020 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 Quote Link to comment
Squid Posted February 16, 2020 Share Posted February 16, 2020 Have you tried rebooting? 1 Quote Link to comment
QLSL Posted February 17, 2020 Author Share Posted February 17, 2020 8 hours ago, Squid said: 您是否尝试过重启? yes I even reset my root password Quote Link to comment
Keeton1 Posted February 29, 2020 Share Posted February 29, 2020 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. Quote Link to comment
limetech Posted March 2, 2020 Share Posted March 2, 2020 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. Quote Link to comment
Darsy Posted March 6, 2020 Share Posted March 6, 2020 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. Quote Link to comment
limetech Posted March 6, 2020 Share Posted March 6, 2020 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 1 Quote Link to comment
karoldo Posted May 4, 2020 Share Posted May 4, 2020 (edited) 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, 2020 by karoldo Quote Link to comment
ayfeQJXvPcdhrEzY Posted October 13, 2021 Share Posted October 13, 2021 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. Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 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 Quote Link to comment
itimpi Posted December 30, 2021 Share Posted December 30, 2021 Have you tried clearing the cache in the browser? Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 1 hour ago, itimpi said: Have you tried clearing the cache in the browser? No difference, thanks for the advice anyway. Quote Link to comment
itimpi Posted December 30, 2021 Share Posted December 30, 2021 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? Quote Link to comment
Squid Posted December 30, 2021 Share Posted December 30, 2021 Set a password in the local GUI? Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 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. Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 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 Quote Link to comment
itimpi Posted December 30, 2021 Share Posted December 30, 2021 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. Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 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 Quote Link to comment
Squid Posted December 30, 2021 Share Posted December 30, 2021 30 minutes ago, LucaV said: now i don't see the logout button Because there's no password set. Try it again. Quote Link to comment
LucaV Posted December 30, 2021 Share Posted December 30, 2021 56 minutes ago, Squid said: Because there's no password set. Try it again. there is a password set Quote Link to comment
Recommended Posts
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.