10

I am trying to mount a windows share using this command:

sudo mount -t cifs -o username=USERNAME,password=PASSWORD \\192.168.2.12\TestShare mnt/

But it is giving me this error:

mount.cifs: bad UNC (\192.168.2.12TestShare)

I have also tried these commands:

sudo mount -t cifs -o username=USERNAME,password=PASSWORD \\192.168.2.12\\TestShare mnt/
sudo mount -t cifs -o username=USERNAME,password=PASSWORD \\192.168.2.12:\TestShare mnt/

But they all give me the same error. The file is shared and the name and password are correct. I have also installed cifsutils.

Does anyone know what I am doing wrong? Does it have something to do with the WORKGROUP?

Black Magic
  • 203
  • 1
  • 2
  • 6

2 Answers2

19

try reversing the slashes and pointing to the root mnt folder

sudo mount -t cifs -o username=USERNAME,password=PASSWORD //192.168.2.12/TestShare /mnt/ 

if your password or username contains special characters try simplifying them.

rob
  • 2,813
  • 4
  • 22
  • 31
2

It works following way ,too

    sudo mount -t cifs -o username=USERNAME,password=PASSWORD '\\192.168.2.12\TestShare' /mnt/ 

By wrapping in single quotes, you can copy-paste the url directly without slash (/,) modifications.