You are currently viewing Recovering Plastic Login Tokens

Recovering Plastic Login Tokens

My main PC suffered a series of hardware failures recently, resulting in unneeded downtime. I’m not sure what happened, but I’ve had to replace all case fans (two of them were dead and one was on the way out), a hard disk drive, and now some RAM that completely failed memtest86+.

This is what it looks like when your RAM files for retirement at the age of 3.

I’m development lead at ABI, so while I wait for my new RAM to work it’s way through UPS, I still need to be there for our teams. So, I need to be able to log into our version control system from my laptop.

While we’re moving to git, a large portion of our code is still on Plastic SCM, which Unity is trying to rename to Unity DevOps Version Control with little public traction. Unfortunately, my login details were lost to the sands of time and I didn’t feel like bothering the CEO (who is very busy) with a trivial problem.

So, I did a danger and opened Plastic on my ailing Windows 10 desktop with procmon open. Here’s what I found:

Finding Plastic

Plastic is designed for multiple platforms, so it will pull from the following folders:

%LOCALAPPDATA%\plastic4Windows (%LOCALAPPDATA% is replaced by your OS)
$HOME/.plastic4Linux/Mac ($HOME is replaced by your OS)

In each of these directories, you have a collection of files.

  • profiles.conf – Your login profiles
  • client.conf – Global client configuration, including merge tools
  • cloudregions.conf – Which clouds you are logged into and their addresses
  • cryptedservers.conf – Encryption information for various servers
  • [gibberish].key – A cryptographic key

And so on.  DO NOT COPY ALL THESE FILES – Merge tools and other settings can vary between machines, especially between operating systems.  A select set of files can be copied, but no more.

Here’s how to just get your login working on another PC.

Saving Private Token

Make sure you close Plastic and back up your plastic4 directory on both ends before continuing.

Plastic uses a couple of bits of information to log in to a cloud server:

  • Cloud Name
  • User Profile
  • Login Token
  • Repository Encryption Key

We need to extract this information, but only this information, and then copy it to our target PC. To this end, open up your favorite file transfer method, and copy the following files but only the following files:

  • All *.key files
  • cloudregions.conf
  • cryptedservers.conf
  • profiles.conf
  • tokens.conf

You should now be able to open plastic on your target PC and select your user profile, then open your repositories.

Hope this helps someone else.