Server credential reset utility for Linux-based platforms

It’s pretty simple.

My PMS is running on Ubuntu server VM. I wanted to download the script directly to the server so I used wget but got 404 on the short-url. > “https://forums.plex.tv/uploads/short-url/5uRJGJnR6s7o6G8cTxMRw6Hv5jO.tar

My workstation is running Windows. This is where I am browsing and writing to you now. I use Notepad++ for more complex things and notepad for simple stuff.

“The contents of the tar ball is already” the file I created did not have 775 permissions, so I used +x to get execute permission on the newly created file.

If did it this way instead of using WinSCP or similar to get the script over to the server.

I’m running Plex using the app on a TS-253-A and as for the tar file it’s in /share

Thanks for helping me out!

@vivid.water

Click-download the file, keeping in in the TAR file, then when you SCP the tar file over to the Linux VM, you won’t have any fussing around to do on the Linux side.

  1. SCP the file to your username. (it will end up in your home directory)
  2. SSH/Putty into the machine, landing in your home directory
  3. sudo tar xf UserCredentialReset.tar
  4. sudo ./UserCredentialReset.sh

This is why I published it in a tar file. tar protects the script even if on a Windows host.

Linux noobie here. I managed to enable SSH and extract the UserCredentialReset.sh script. When I run it using “sudo ./UserCredentialReset.sh” I get the error:

Unrecognized host type. Cannot continue.

Ok I manage to put the tar file in a better place (I think).
In the PlexShare wich helped me extracted the tar and run it.
I get ERROR: PMS is running. Please stop PMS and try again. wich i did via app center…
Is there a proper command to stop the server?

@yeffiely

you put the file in /share or /share/Public ?

Regardless where you put it on the QNAP, we’re in good shape.
I’m going to walk through with you.

  1. SCP the file to /share on the qnap
[chuck@lizum bighammer.794]$ scp UserCredentialReset.tar admin@ts128:/share
UserCredentialReset.tar                                                                       100%   10KB   6.9MB/s   00:00    
[chuck@lizum bighammer.795]$ 
  1. SSH/Putty into your QNAP . You’ll end up at the command line prompt somewhere
[chuck@lizum bighammer.795]$ ssh -l admin ts128
.. login stuff here..  now on the QNAP...
[~] # pwd
/root
[~] #
  1. cd to where we need be (where the tar file is) and confirm it’s there
[~] # cd /share
[/share] # ls
4k@		     faketv@	HDG_DATA/  HDN_DATA/  HDU_DATA/  movies@      PlexData@   uhd@
animated@	     HDA_DATA/	HDH_DATA/  HDO_DATA/  HDV_DATA/  Multimedia@  Plex-QPKG@  usenet@
CACHEDEV1_DATA/      HDB_DATA/	HDI_DATA/  HDP_DATA/  HDW_DATA/  music@       Public@	  UserCredentialReset.tar
CHUCK-QPKG-SPECIAL@  HDC_DATA/	HDJ_DATA/  HDQ_DATA/  HDX_DATA/  nas@	      test@	  VideoStation@
Container@	     HDD_DATA/	HDK_DATA/  HDR_DATA/  HDY_DATA/  NFSv=4/      test2@	  Web@
Download@	     HDE_DATA/	HDL_DATA/  HDS_DATA/  HDZ_DATA/  oldmusic@    tv@	  xfer@
external/	     HDF_DATA/	HDM_DATA/  HDT_DATA/  homes@	 Optimized@   tv2@
[/share] # 
  1. Now we extract the utility from the tar file.
[/share] # tar xf UserCredentialReset.tar 
[/share] # 
  1. We start it up
[/share] # tar xf UserCredentialReset.tar 
[/share] # ./UserCredentialReset.sh 
 
          Plex Media Server user credential reset and reclaim tool (QNAP)
 
This utility will reset the server's credentials.  It will then reclaim the server for you via a Plex Claim tokem from Plex.tv
 
Please enter Plex Claim Token copied from http://plex.tv/claim : 
  1. Next step is to open Claim | Plex and COPY the token.
  2. Return to this SSH session and PASTE the claim-xxxxx string .
Please enter Plex Claim Token copied from http://plex.tv/claim : claim-s51jKQsGUtM18yXxL8z7
Clearing Preferences.xml
Preferences.xml cleared
Getting new credentials from Plex.tv
Claim completed without errors.
 Username: ChuckPA
 Email:    ChuckIsCrazy@loonies.com

PMS is now ready to go

1 Like

Go to App Center – Stop PMS normally.

If it still thinks it’s running…

ps -ef | grep -i plex

There might be something else hanging around.

Which Linux / host / environment are you running on?

I don’t have a lot of “host personalities” defined yet. (been a lot to do in a short time)

If PMS is running on it , and it’s a Linux workstation/server environment, then I should be OK.

This is on a Synology DS200+ NAS. Not sure the Linux version. I enabled SSH access and I’m running the script from Putty.

@EXPTA

I have a MUCH easier way for you if you have DSM 7 :slight_smile:

Please check that first. I’ll give instructions once we know if DSM 6 or DSM 7

Hello ChuckPa. I’m trying the same… and I have “error: pms is running” too. I put the command ps -ef | grep -i plex, but the pms is still running

Running DSM 7

@EXPTA

You’re going to be VERY happy. This code is already built into the DSM 7 package installer.

  1. Uninstall the package with the “Uninstall Only – KEEP” option
  2. Now Manual Install the SPK file again
  3. At the first menu, click “Install using Plex Claim Token”
  4. Also click “Get Plex Claim Token” link.
  5. A browser tab will open and show you your claim token
  6. COPY it
  7. Come back to the Syno package install screen and PASTE it into the little box
  8. Click NEXT and DONE
  9. It will start installing the code again – AND – it will claim it for you.
2 Likes

If you tried to stop PMS normally … AND it won’t stop …

sudo pkill -15 'Plex Media Server'
-or-
sudo kill -15 $(pidof 'Plex Media Server')
Now check again for processes.

Thanks - this definitely helped resolve my problem after the password reset. I would highly suggest getting instructions like this included in the same message that was sent to everyone to reset their password.

@ego_alter

When they sent that email, this utility didn’t exist nor was it even an idea.

Now, given events, i am going to take the action item to see what else can go ‘wrong’ and be prepared.

It still doesn’t work. I’m certainly too stupid…

@StephanAdmin

:man_facepalming:

Look at your command line. ./Plex :eyes:

It’s seeing itself because you invoked with the full path name.
Get around it by:

cd ./Plex/tmp
./UserCredentialReset.sh

I will change the script to be MUCH smarter. Thank you for this one.
This is on me :see_no_evil:

1 Like

@StephanAdmin

Fixed :sunglasses:

:rofl:

It seems to work, but Murphy is very busy with me! :wink:
Now I have following screen and I cannot choose any of the options…

:rage:

I have the problem only with the admin account, not with the others… and for the others, i works
THANK YOU ChukPa VERY VERY MUCH!!! :+1:

Now I only must solve this new problem…