5

since the update to Ubuntu 17.10 my script to mount shares from a NAS does not work anymore. On older versions of Ubuntu I could use this line:

mount -t cifs -o username=t0b1,password=$pw //server.local/shared/ /media/shared

Adding another option to specify the version does not seem to change anything:

mount -t cifs -o vers=1.0, username=t0b1,password=$pw //server.local/shared/ /media/shared

When I run the script on Ubuntu 17.10 the only output I get is a list of options for "mount" but it does not mount my shares. Does anyone know what exactly has changed with cifs on 17.10? Any idea what I could change here?

EDIT: This line actually works:

mount -t cifs -o  username=t0b1,password=$pw,vers=1.0 //server.local/shared/ /media/shared

But I think using version 1.0 is only a temporary workaround because it has some known security issues. There should also be a way to get it running with version 3.

  • wiki.ubuntu.com/ArtfulAardvark/ReleaseNotes says "Samba was updated to version 4.6.7. Noteable changes in the 4.6.x series include ..." (ps: i'm only giving info on last 'does anyone know' part of question; I don't use samba or 17.10 so can't help further) – guiverc Oct 21 '17 at 9:59
  • Ok thanks. I have read the list of changes there but I can't see anything that would actually change the behavior of my script. – t0b1 Oct 21 '17 at 10:05
  • i don't use samba regularly, nor 17.10, so can't help with new release. it was a brief summary highlighting a later version of samba (ibm protocol SMB from which we get SaMBa; m$ft started calling it CIFS). If you were using 17.04 (samba 4.5.8) its quite a few releases later, and the wiki page linked to samba.org website with loads of changes (esp. if you follow back to version in 17.04; 14 just for 4.6.7 on first page). maybe wait for someone else to provide a quick answer – guiverc Oct 21 '17 at 10:40
  • 1
    check out askubuntu.com/questions/966966/… or tldr: add vers=1.0 to the mount options – guiverc Oct 21 '17 at 10:50
  • same problem here, does anyone confirmt that vers=1.0 works? – yemu Oct 26 '17 at 6:55
9

I had the same problem after upgrading to Ubuntu 17.10. Suddenly, my CIFS shares would no longer mount. Adding vers=1.0 to the mount options fixed it for me. Admittedly, this is a bit of a bodge, but some network share access is better than no network share access.

My /etc/fstab file previously had the following 4 lines at the bottom:

# Network File Shares
//phc.imsu.ox.ac.uk/phc     /mnt/PHC        cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777 0   0
//phc.imsu.ox.ac.uk/departments /mnt/DEPARTMENTS    cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777 0   0
//femur.imsu.ox.ac.uk/phc_cprd  /mnt/PHC_CPRD       cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777 0   0

Changing them to:

# Network File Shares
//phc.imsu.ox.ac.uk/phc     /mnt/PHC        cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777,vers=1.0    0   0
//phc.imsu.ox.ac.uk/departments /mnt/DEPARTMENTS    cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777,vers=1.0    0   0
//femur.imsu.ox.ac.uk/phc_cprd  /mnt/PHC_CPRD       cifs    credentials=/home/benjamin/.smbcredentials,iocharset=utf8,sec=ntlm,dir_mode=0777,file_mode=0777,vers=1.0    0   0

Resolved the issue.

  • worked for me too on Ubuntu 16.04.4 (Ubuntu 16.04.1 did not need it) I lost the last hour of my life beacuse of this. – Sridhar Sarnobat Jun 4 '18 at 4:27
3

Try this:

mount -t cifs -o vers=1.0,username=t0b1,password=$pw //server.local/shared/ /media/shared

That is, the same as your first try but without space. They are not allowed in the options. That is probably the reason why the mount does not see username ans password.

  • This line works but i will leave the question open. Maybe someone can come up with a solution without this workaround to use the older version. – t0b1 Oct 28 '17 at 14:37
  • Just to add that with similar scenario but using autofs was also solved by adding 'vers=1.0' to the existing line in auto.nfs :- USB2 -fstype=cifs,rw,bg,intr,noperm,vers=1.0,user=,password= ://192.168.1.172/USB2 – Andrew Barker Jan 15 '18 at 12:03
0

The combination of mount options that worked for me with Ubuntu 17.0 on 5-Feb-2018 is:

username=guessmyusername, password=guessmypassword, iocharset=utf8, sec=ntlmv2, vers=2.1

These work with mount points in /etc/fstab as well as with the mount-t cifs command.

Changes in the CIFS protocol have confounded more than a few of us ever since version 1. I suspect as time goes on, the values for sec and version will become stale, but updating them will probably be the answer when you can't connect to the windows share from Linux, but can connect from windows.

Many of the suggestions on old posts indicate you should have sec=ntlm. It took a while before i found mention of ntlmv2. Others say you should use vers=1.0 (very obsolete and insecure)

The server is a laptop running windows 10. Checking there revealed that the server was using CIFS 3.1.1. Naturally, I tried that. It didn't work. I fell back to 2.1 with ntlmv2 and everything started working.

Different combinations of sec and version parameters that did not work showed different error messages, some misleading, some obsolete, some just cryptic.

Regardless of the messages seen when the mount failed, The only problem here was the security negotiation not completing. The message indicating a resource is not available, apparently refers to a component of the security negotiation, not to the share you're trying to connect to.

Further, the messages as shown in the terminal and those found using dmesg|grep CIFS differ. I needed to look at both to figure out what was happening.

Things tried:

dmesg|grep CIFS to view error messages Use /etc/fstab and sudo mount -a to mount the share (works now) Use mount -t CIFS ... (also works now)

0

This is what worked for me. After multiple tries.

  1. I reinstall all clients after complete purging

    $ sudo apt install cifs-utils smbclient nfs-common

  2. Then created and mount point. $mkdir ~/myfiles

  3. Then mount this way:

    sudo mount -t cifs -o vers=1.0,credentials=/home/username/.smbcredentials,dir_mode=0777,file_mode=0777 //192.168.2.5/g$/shares/Techno\ Files /home/<username>/myfiles/

My culprits are the paths(drives on windows server). eg. c$, g$,f$, then the file path. The Ubuntu docs states you should escape spaces with \040\ eg new\040Folder but it failed for me. So i went with the traditional Unix space escaping.

protected by Community Jan 15 '18 at 15:00

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.