Server credential reset utility for Linux-based platforms

I recommend putting the UserCredentialsReset.tar in /share/Public for now.
It makes it much easier to get to via Putty.

Via putty

  1. Log in to the QNAP
  2. sudo bash (this gives you ‘admin’ rights)
  3. cd /share/Public
  4. tar xf UserCredentialReset.tar

Confirm it extracted ok and you have both the tar and sh files:

ls -la UserCredential*

Now we get started

  1. In Putty window: ./UserCredentialReset.sh
    – It make sure PMS is stopped
    – It will make sure you’re ‘admin’ (which you are)
    – It will figure out the host it’s on – and show (QNAP)

  2. There will now be a prompt to enter the claim token.

  3. In a new tab, open Claim | Plex

  4. It will present you with the claim token. Hit the COPY button to copy it to the browser

  5. Flip back to the Putty session window

  6. PASTE (right click) and see the token get pasted in.

  7. Hit Enter

  8. After a few seconds it will respond with your Username and Email address

  9. This confirms everything went ok.

  10. Now for the fun

  11. Open an incognito window

  12. In that window, open the QNAP’s IP address http://ip.addr.of.qnap:32400/web

  13. You’ll get the warning about ‘not hosted by plex’ – ignore it and continue to sign in.

  14. The browser and server will sync.

  15. You may / may not get the offer to enable the discover service – your choice there or SKIP

  16. You might be in an odd spot of where the browser is pointing. Go to the left side and get back to your server’s name and confirm your libraries are there.

That’s it… Once you see your libraries, you’re done with this.

You can sign out of putty and use PMS normally

@ChuckPa - Just wanted to say thank you for this! Worked like a charm on my Synology.


Ok, so this is where I am. Linux is very confusing

I put the Tar file in my directory shown as home. Now when I look into the home directory I do not see the user credential file. I do see . .. Can you give me a hint as to where the file would end up?
Also I tried the locate command and it could not find it.

When you logged in. you were in your home directory.

To see the actual name of it,
type: pwd (which means “print working directory” – aka where am I at ?)

To see the files: ls (which means "List the files, sorted alphabetically)

Whenever you move around, if you get lost cd (change directory with nothing else added… ALWAYS takes you to your home directory.

It looks like you (from this screenshot)

  1. signed in as the root user (full powers)
  2. manually typed cd /home (which took you away from you signed in and landed)
    and landed you at the top of the filesystem where ALL the home directories for everyone is.

I’m curious to find out if the files are really in your “Home” directory

# cd
# ls

type cd to get back to where you started
now type ls to list the files there.

If it goes as I expect, you’ll see the UserCredentialReset.tar file

IF it’s not there:

cd /home
ls

Now look and see if it’s there ?

FYI: ‘locate’ wont’ do you any good until tomorrow. LInux does maintenance overnight and will update that command. (it’s like plex scanning for media)

Thanks @ChuckPa !

I could not get the manual instructions to work at first, and then also not your script, but it made me figure out that because of some misconfigured Docker setup, no traffic was possible from the entire Synology NAS. After fixing that, your script worked flawlessly.

After three days (no thanks Plex) we got a working server again, thanks!

That is such a nice thank-you note! More people should do that!

1 Like

Thank you for your kind words.

It was a very long week with insanely long hours and over 1500 messages (1542 to be exact-- haha) in my inbox (posts to reply to)

1 Like

If it’s not too much to ask, I’d also love to get your help, @ChuckPa

I’ve jumped through a lot of hoops not just wanting to come off as completely uneducated, but so far I’m not having any luck using anybody’s suggestions or efforts.

First off: Synology. 1019+, DSM6 (latest)

Was using PMS 1.28.1.6104… have since tried to both update and rollback to and from 1.28.1.6106

Password was updated using the initial instructions in the email. I retain both the original password, and the updated one.

ISSUE: Obviously, can’t get PMS back up and running.

CURRENTLY: I can connect to the server, it states the server is unclaimed and not secure. When I navigate in to the server list from the settings, hitting the “claim server” button has no effect. The first time the “reinstallation” runs, I’m greeted with a promising “let’s set up your server”… but an error pops up that says “there was a problem claiming this server”. Occasionally I’ve seen “Failed to sign in to plex account” on the PMS->Options, but it seems to only happen the first time.

I’ve tried running the latest tar->sh from Scheduled Tasks… though looking at the “view result” action only shows “running”, and eventually “interrupted (1)”. I briefly tried using puTTy (completely new to me), but I wasn’t able to gain proper permissions to run from root (or admin?). I did (at one point) see the “with great power” puTTy message, but I didn’t know which password it was looking for, and was somewhat demoted (I couldn’t run the “sudo” thing again?).

I’m nearing 24 (non-continuous) hours of failure, and with an infant and a pumping wife, this is the straw that could break the camel’s back.

Is there anything you might recommend that I try? I’m now completely lost.

UPDATE: I figured out ROOT through PuTTY. I’m now receiving: “ERROR: could not get credentials from plex.tv (Error: 6)”

Now that’s where I’m stuck… what’s an Error 6, and why am I getting it/how do I resolve it? PS - I’ll gladly pay your $10 fee for the correct answer, and welcome all of the accompanying looks!

(just waking here – need more :coffee: )

ERROR 6 = DNS lookup failure.

What’s the Gatway address and DNS lookup address for the Syno?
Are they both pointing to the modem/router ?

ROTFL on reading my profile! LOL

Thanks! This helped resolve my problem as well.

I am running Plex on QNAP. After resetting my password, my server got unlisted and aI could not register it to my Plex account. I’ve tried several times to login from the local IP, but still could not see my libraries. I’ve even followed this article to delete the
Preferences.xml file:

The only thing that helped was the script. I’ve executed it on my NAS and was able to see my Plex server.

Thanks!

To all who find this:

I’ve been alerted to the need for WD support.

WD is now supported (limited to “NAS” models - non-Android) by this utility.
(“PR” series, “DL” series, and “Ultra”)

It’s not had extensive testing across all models. (the detection logic)
PLEASE let me know if there are any difficulties.

Is not perfect I paid this app not to do this stuff!!!

Folks,

I’ve make some significant advances.

  1. WD OS5 boxes are now fully supported
  2. Remote servers are supported (including Syno, QNAP, VPS, etc)
  3. First access via LAN IP no longer required.

Hello,

I get the same answer and the script is blocked…
Any idea to install curl or use the path /usr/builtin/bin/curl :

admin@premier-clap:/volume1/Download $ sudo sh UserCredentialReset.sh -p "/volume1/Plex/Library/Plex Media Server/Preferences.xml" claim-aTheLyQ1wBtxiqMAJvFp
Password: 
 
          Plex Media Server user credential reset and reclaim tool (User-Defined)
 
This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim
 
 
This utility requires the 'curl' command which is not found.
Please install 'curl' or add it to 'path' if already installed.

Thank you in advance

On Ubuntu / Debian boxes - sudo apt install curl
On Redhat boxes - sudo yum install curl (but it should be there)
On Fedora boxes - sudo dnf install curl (but it should be there)

Thank you @ChuckPa for your quick answer.

None of these command works on asustor.
It seems that curl is installed yet. But it doesn’t work.
So i try to install curl again through Entware (opkg install curl). But it doesn’t work.

According to the error message, i try to add the path to the command, without success :

admin@premier-clap:/volume1/Download $ sudo sh UserCredentialReset.sh -p "/usr/b
uiltin/bin/curl /volume1/Plex/Library/Plex Media Server/Preferences.xml" claim-f
EUXY_C6KoKxmNfBLHZ7

I will let you know if i find something.

@jbo44112

The -p option is for specifying the Plex Preferences.xml location, not the $PATH variable :slight_smile:

I wrote this using the sample machine provided to us.

[chuck@lizum ~.1422]$ ssh -l root as6102
Password: 
root@ASUSTOR-AS6102T:/volume1/.@root # curl
curl: try 'curl --help' or 'curl --manual' for more information
root@ASUSTOR-AS6102T:/volume1/.@root # which curl
/usr/builtin/bin/curl
root@ASUSTOR-AS6102T:/volume1/.@root #

EDIT: I did find a non-related issue for ASUSTOR which only impacts that machine.
Bug is fixed. Released.

Issue is resolved: Version tag is v1.0.3

Hi ChuckPa,

Thanks a lot for helping.
Unfortunately, I am not at all technical and english is not my primary language so I am a little bit lost here and bloacked at step 2 :frowning:

  1. Stop Plex
  2. Place the tar file on the host and extract its contents. tar xf ./UserCredentialReset.tar. You will see file UserCredentialReset.sh
    what do you mean with “on the host”?
  3. Open a terminal window or SSH session to the host.
  4. If needed, using sudo, elevate your command line shell to root (admin on some machines
  5. Invoke the utility ./UserCredentialReset.sh
  6. It will confirm the host platform type (so it knows what to do)
  7. It will confirm you have sufficient user privilege and PMS is stopped
  8. It will then prompt for a “Plex Claim Token”.
  9. Open a browser tab to: Claim | Plex
  10. COPY the given token
  11. WITHIN 4 Minutes, PASTE the token on the utility’s command line
    (The token expires so we need be quick)
  12. Hit Enter and it will immediately complete the task.
  13. When complete, It will verify all your credentials are valid and then update Preferences.xml for you
  14. It will print out your Plex username and email used in case you have multiple accounts.
  15. Utility then exits.
  16. Start PMS. It will be back to normal.

The host is the system where Plex Media Server is installed and running.

A .tar file is an archive file. It is the Linux equivalent of a .zip file on Windows systems.

Step 2 is telling you to copy the file to the system running Plex, then extract the script from the archive.

tar xf ./UserCredentialReset.tar is the command used to extract the file from the archive.

You enter it using the command line interface, the Linux equivalent of the Windows c:\ command window prompt.

Thanks.
When I downloaded the .tar, it automatically extracted the .sh file.
I cannot find where Plex is installed.
I put the .sh file at the root of C:? Or in user?