Jellyfin Forum
SOLVED: Locked out of admin account - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access)
+---- Thread: SOLVED: Locked out of admin account (/t-solved-locked-out-of-admin-account)



Locked out of admin account - toparity - 2024-02-21

Hello,

When I attempt to log into my jellyfin server I recieve this message:
Quote:You are not authorized to access the server at this time. Please contact your server administrator for more information.
System Info:
Running the latest jellyfin by using Docker compose. I'm running Debian 12.5 on an x64-x86 architecture off an SSD.

Here are my log files.

What I have tried:

Attempt 1:
The first thing I did is check the logs. I provided them in the pastebin link above. The line that stood out at first was:
Quote: [2024-02-21 19:37:48.954 +00:00] [WRN] [55] Jellyfin.Server.Implementations.Users.UserManager: Disabling user "[MyAdminAccountHere]" due to 3 unsuccessful login attempts.
I don't fully believe that I got the password wrong three times as when I first went through the start up wizard I made the account using Bitwarden, saved the password and have logged in multiple times successfully with it. It did cross my mind that maybe someone had tried to brute force their way in, but my home network isn't exposed to the internet: I've never port forwarded any traffic on my router, I don't have a reverse proxy, I haven't even configured a VPN. I checked the account of a standard user that I have the login details for, that also didn't work. So I simply ran "systemctl restart docker" and tried again, with it still broken.

Attempt 2:
The next thing I came across was this page, I ran through each step for the Repair Permissions section with no luck. At first I didn't restart jellyfin. On the second go, I ran "systemctl stop docker", verified no jellyfin image was running with "docker ps", edited jellyfin.db again and then restarted with "systemctl start docker". This still didn't help.

Attempt 3:
I edited the system.xml file and edited it to set "<IsStartupWizardCompleted>" to false. I ran through the start up wizard again, added a new account only to find this was also locked out, with the same message. Here are the logs for part of this process.

What I'm thinking:

I am using firefox to access the server over my home network. I have firefox configured to delete all data (history, cookies e.t.c.) when I close it. I noticed the number of session growing and I did have the number of active sessions allowed for everyone at 1, besides the admin account which had 5 (or maybe 3). Is it possible that I cannot log in because I've exceeded the maximum number of sessions? This doesn't really explain why the brand new admin account, made through the start up wizard, didn't work, but I'm starting to run out of ideas.

Is there anyway to clear/forget all sessions from the command line, or by editing a configuration file? I could shutdown jellyfin and docker, try that (if a way to do that even exists) and edit jellyfin.db again for good measure. Or does anyone else have any ideas?

Any help at all is appreciated, I'm a bit stuck for what else to try. If I've neglected any obvious information or you need more logs, please let me know.

Many thanks,
Toparity


RE: Locked out of admin account - TheDreadPirate - 2024-02-21

Follow this guide in our docs.

https://jellyfin.org/docs/general/administration/troubleshooting/#unlock-locked-user-account

Make sure to stop jellyfin prior to doing this.


RE: Locked out of admin account - toparity - 2024-02-21

(2024-02-21, 11:01 PM)TheDreadPirate Wrote: Follow this guide in our docs.

https://jellyfin.org/docs/general/administration/troubleshooting/#unlock-locked-user-account

Make sure to stop jellyfin prior to doing this.

Thanks for the reply but I already tried this and explained the process in my post, under the "attempt 2" section. It didn't work for me. Besides not stopping jellyfin (which I did), is there anything else that could cause these steps to not work?


RE: Locked out of admin account - TheDreadPirate - 2024-02-21

Did you copy and paste the commands without changing the username? You need to replace LockedUserName with your actual username. Confirmed this worked on my docker setup.


RE: Locked out of admin account - toparity - 2024-02-21

Yeah I put my own username in, I read the full section, I ran this:

Quote:UPDATE Permissions SET Value = 1 WHERE (Kind = 0 OR Kind = 3 OR Kind = 4 OR Kind = 5 OR Kind = 6 OR Kind = 7 OR Kind = 8 OR Kind = 9 OR Kind = 10 OR Kind = 11 OR Kind = 12 OR Kind = 13 OR Kind = 14 OR Kind = 15 OR Kind = 16 OR Kind = 17 OR Kind = 18 OR Kind = 19 OR Kind = 20 OR Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = [MyAdminUsernameHere]);



RE: Locked out of admin account - TheDreadPirate - 2024-02-21

These are the two commands that you should be running.

Code:
UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = 'LockedUserName';
UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = 'LockedUserName');

Replace the username.


RE: Locked out of admin account - toparity - 2024-02-21

Ah I reckon that's it!

I read and did everything in "Fix Admin User Permissions" but not "Linux CLI". Stupid of me.

I'll try that when I'm next at my PC and mark the thread as solved if (when) it works.

Thanks for the help.


RE: Locked out of admin account - toparity - 2024-02-22

So, an update. I ran these commands:

Quote:docker stop jellyfin
UPDATE Users SET InvalidLoginAttemptCount = 0 WHERE Username = '[MyAdminUsernameHere]';
UPDATE Permissions SET Value = 0 WHERE Kind = 2 AND UserId IN (SELECT Id FROM Users WHERE Username = '[MyAdminUsernameHere]');
UPDATE Permissions SET Value = 1 WHERE (Kind = 0 OR Kind = 3 OR Kind = 4 OR Kind = 5 OR Kind = 6 OR Kind = 7 OR Kind = 8 OR Kind = 9 OR Kind = 10 OR Kind = 11 OR Kind = 12 OR Kind = 13 OR Kind = 14 OR Kind = 15 OR Kind = 16 OR Kind = 17 OR Kind = 18 OR Kind = 19 OR Kind = 20 OR Kind = 21) AND UserId IN (SELECT Id FROM Users WHERE Username = '[MyAdminUsernameHere]');
docker start jellyfin

This didn't work.

But, I did get it working eventually. The problem, once again, was me. Turns out I need to touch up on my docker skills. I had started jellyfin using docker compose, yet I was using standard docker commands to try and stop it to edit the database. At some point I had accidentally started a standard docker instance too, I had two of the little fuckers running at the same time and things got messy. What I should have done is "docker compose down" to stop jellyfin, edit the database and then run "docker compose up".