Ubuntu 20.04 - need help with mounting Windows Server NFS

Hello everyone!

I’m in need of help with mounting my shared network drive folder (located on my WS2016 computer) to my Ubuntu 20.04 server.

Let’s say I have a folder I want to share that is located at Network path \WS2016\Folders\Folder 1.
In my Ubuntu server I have made a mounting folder located at /mnt/shares.

I’ve installed apt get install cifs-utils.

When I do sudo mount.cifs //WS2016/Folders/Folder 1 /mnt/shares username=nextcloud,password=password I get asked for root password. It gives me error 13 (permission denied). I tried using WS2016 Administrator account and still got error.

Hopefully you can help me. Thanks for reading.

1.) If you use a space at “Folder 1” you must escape it.
2.) Use the option “-o” for username and password

sudo mount.cifs //WS2016/Folders/Folderwithoutspaceorescaped -o username=nextcloud,password=password /mnt/shares

If all works use automount in /etc/fstab
http://timlehr.com/auto-mount-samba-cifs-shares-via-fstab-on-linux/

I got mounting to work, used:
sudo mount.cifs //192.168.10.101/Users/User1/Documents/Jagatud -o credentials=/.smbcredentials /mnt/shares
Now I try to automate this by adding this to /etc/fstab
//192.168.10.101/Users/User1/Documents/Jagatud /mnt/shares cifs credentials=/.smbcredentials,iocharset=utf8,sec=ntlm 0 0 this is not working for some reason. When I do sudo mount -a I get error.

Unable to select appropriate authentication method!
Send error in SessSetup = -22
cifs_mount failed w/return code = -2
No such file or directory.

Any ideas?

Do you really use the file .smbcredentials in path / ?

Test:
sudo /.smbcredentials

Yes, I do have a file for credentials.

I got it to work, I had to change the command into //192.168.10.101/Users/User1/Documents/Jagatud /mnt/shares cifs credentials=/.smbcredentials,iocharset=utf8,sec=ntlmssp 0 0 (sec=ntlmssp instead of ntlm). Now I have to check what’s the difference. :stuck_out_tongue: