WSL - mount error(13): Permission denied

Issue

Trying to mount a share located on a Windows 10 PC from Ubuntu WSL (Windows Subsystem for Linux)  running on Windows 11 machine:

sudo mount -t cifs //192.168.1.25/Data /mnt/WinShare -o username=lin,password=Some$Psw@55

The operation fails with the following error:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

I checked Windows Security logs on the target Windows 10 PC, and for every mount attempt, there was Event 4625 - Logon Failure - Unknown user name or bad password.
This made it clear that Ubuntu was connecting and communicating with the Windows 10 PC, but for some reason, Windows was not accepting login credentials.

Resolution

The issue was fixed by simply enclosing the password in single quotes. Even though the password didn't have any spaces, it had a couple of special characters ($ and @) which likely caused the issue. The final command that worked was:

sudo mount -t cifs //192.168.1.25/Data /mnt/WinShare -o username=lin,password='Some$Psw@55'

November 2021
Windows 11 Pro (21H2)
WSL (Ubuntu)

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait