How to unlock `WD My Passport Drive` on Linux

By default WD My Passport Drive supports only Windows and OS X. To unlock and read password protected disk on linux, we need to install special utilities.

Get utils for WD My Passport Drive

  1. Install required packages:
  2.  Install py_sg library:
  3.  Download wd utils to your home directory:
  4.  Everything is ready 😉

Unlock WD My Passport Drive

  1. Plug in your password protected drive.
  2. Run in terminal this command and enter password:

 

Change/create/remove password on WD My Passport Drive

  1. Plug in your drive.
  2. Run in terminal this command and enter password:

     

I ask you to review this article

Rating 4.7 Stars from 41 reviews

25 thoughts on “How to unlock `WD My Passport Drive` on Linux”

      1. hello again, the previous command worked but now its saying “Something wrong opening device “””.

        1. Im getting the same error…

          WD Passport Ultra linux utility v0.1 by duke
          [!] Something wrong opening device

          I want to eventually mount this USB drive and share the content but dont want to have to run this script every time I reboot the box. If I fix the error above, could I get this added to my fedora boot somehow? /etc/fstab?

  1. Thanks for the script, however I’m getting an error:

    [radial@phraxis ~]$ ./wdpassport-utils.py -u
    File “./wdpassport-utils.py”, line 13
    except ImportError\, e:
    ^
    SyntaxError: unexpected character after line continuation character

    I’m running Manjaro 17.1.11 (i3), Python 3.6.6, pip 10.0.1 from /usr/lib/python3.6/site-packages/pip (python 3.6)

    Any help really appreciated 🙂

    1. Hey Radial,
      How did you solved this error?
      $ ./wdpassport-utils.py -u
      File “./wdpassport-utils.py”, line 13
      except ImportError\, e:

      Thanks in advance,
      Jorge

      1. Late answer: I got the same error, but the solution is to try running sudo ./wdpassport-utils.py -u
        With sudo it worked for me, no more error.

  2. Works great ! Thank you very much 🙂

    I have encrypted the drive in Windows by utility from WD and I was able to unlock it by this script at Fedora 27.

  3. What about contacting WD if they want to include this into their official page ? I think many people would highly appreciate that and you could get some credit 🙂

    Good job !

  4. This worked for me:
    :~$ sudo python2.7 ~/wdpassport-utils.py -u
    WD Passport Ultra linux utility v0.1 by duke
    [+] Insert password to Unlock the device
    Password:
    [*] Device unlocked.

    Cheers,
    Jorge

  5. Thanks, it works. Now is it possible to create a shortcut for the command? Otherwise everytime we have to open the terminal and type. Please tell me if it is possible.

  6. In linux mint 19.1 when I type: sudo pip install py_sg
    in the terminal I get an error message. Cannot locate py_sg package and cannot locate py_sg module.

  7. except ImportError, e:
    ^
    SyntaxError: invalid syntax
    It is showing this error on my Ubuntu 16.04

  8. This is the most fantastic thing EVER!. I have a 2TB drive that I bought 4 years ago and completely forgot the password. I only use Linux now and this worked perfectly. Hopefully WD gets the message and includes this on their page as previously stated.

  9. i have a problem after i run :
    sudo pip install py_sg

    it says :
    The directory ‘/home/amirmohammad/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
    The directory ‘/home/amirmohammad/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
    Collecting py_sg
    Downloading https://files.pythonhosted.org/packages/de/fe/aa8b849771ed622e0f734183fe4ddb84648ea017b2a08f308b04bbf779bf/py_sg-0.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File “”, line 1, in
    ImportError: No module named setuptools

    —————————————-
    Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-6G4rtB/py-sg/

    how can i fix it?

  10. hi , For those who have this error :
    $ ./wdpassport-utils.py -u
    File “./wdpassport-utils.py”, line 13
    except ImportError\, e:
    you can run this command instead:
    $ sudo python wdpassport-utils.py -u

  11. Same error than Amirmohammad omidi:
    Traceback (most recent call last):
    File “”, line 1, in
    ImportError: No module named setuptools

    —————————————-
    Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-Y9y7m0/py-sg/

  12. I am running an extra internal HDD on my desktop for additional storage space. Access was initially direct, but at some stage and for reasons unknown to me, I had to enter my password to mount the drive. How do I revert to the original configuration where I had direct access to this drive? System is Ubuntu 16.04 Unity.

  13. Hello,
    All command worked correctly. However, when I type in the last one :
    ~/wdpassport-utils.py -u
    I receive the following message :
    bash: /home/SC/wdpassport-utils.py: Permission non accordée

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 3 =