3

I've a windows shared folder which I can access by typing \\share\files\ in "run".

I need to use that in Ubuntu. So I added \\share\files\ /mnt/share/ cifs guest,uid=0,iocharset=utf8 0 0 in /etc/fstab.
And then issued mount -a. I got directory not resolvable error mount error: could not resolve address for share: Unknown error.

I'm pretty new here, can you please help me?

Edit 1: I tried adding //share/files/ /mnt/share/ cifs guest,uid=0,iocharset=utf8 0 0 in /etc/fstaband issuing mount -a command and got same error.

I used id -u and got 0, used that in uid=0.

Edit 2

I used IP (//192.168.1.222/files/ /mnt/share/ cifs guest,uid=0,iocharset=utf8 0 0) instead of directory path and got the following error message

Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
IFightCode
  • 133
  • 1
  • 7
  • 1
    I think that should be all forward slashes? See https://wiki.archlinux.org/index.php/samba#Add_Share_to_.2Fetc.2Ffstab – Brian Z Oct 04 '14 at 03:54
  • Related (but probably not really a duplicate): [Proper fstab entry to mount a samba share on boot?](http://askubuntu.com/questions/157128/proper-fstab-entry-to-mount-a-samba-share-on-boot) – Eliah Kagan Oct 04 '14 at 04:07
  • I just tried using forward slashes with same error. Any other idea? – IFightCode Oct 04 '14 at 04:39
  • Then edit you question so that it is clear what you tried!! – Kalle Richter Oct 04 '14 at 05:03
  • Have you checked (using `ping` perhaps) that you can resolve share from that PC? – agc93 Oct 04 '14 at 05:11
  • Yes, I could ping the IP. – IFightCode Oct 04 '14 at 05:19
  • You can ping the IP, but can you ping by name? In other words, can your machine resolve the name `share` to the corresponding IP address? – Gord Thompson Oct 04 '14 at 07:46
  • it looks like a password is required (no guest allowed), is that true? did you ever enter a (remembered) password in windows. In that case you need to have a credentials file let me know. Is it a NAS? – Jacob Vlijm Oct 04 '14 at 07:58
  • No, using any windows machine, I can access without using any password. Not sure if that's because of using same workgroup. – IFightCode Oct 04 '14 at 08:02
  • wait, I see you used uid=0 (root), should be 1000 (guest) – Jacob Vlijm Oct 04 '14 at 08:11
  • 1
    Is the `Guest` account enabled on the Windows machine? If not, then you will need to provide credentials for this to work. If the `Guest` account is not enabled and you can connect to the share from another Windows machine without supplying credentials then in that case you are (implicitly) using *pass-through authentication*. – Gord Thompson Oct 04 '14 at 08:11
  • did the uid=1000 change anything? – Jacob Vlijm Oct 04 '14 at 08:33
  • Can you connect to the share from the Ubuntu system by using `smbclient`? Might be easier to troubleshoot that way first before you try to mount. – Brian Z Oct 04 '14 at 09:11
  • Actually guest account wasn't activated, so the issues were arisen. Thanks guys for helping me. – IFightCode Oct 04 '14 at 16:13

1 Answers1

3

To mount a share via fstab, you should:

  • create a mount point (directory) to mount the share into. I am not sure if /mnt/share/ exists?
  • use forward slash
  • add the ip address of the share before the share name in the fstab file.
  • if not installed already: install cifs utils
  • for a guest account (unprotected share), you should use guest,uid=1000 as user id, to make the guest owner.
  • to enter a password protected share, you need to set the user id to the share's user name and the reference to a credentials file (see example below)

As an example, my line in the fsatb file looks like (the \040 is an escape for the space):

//192.168.0.104/werkmap_documenten/documenten\040Jacob /home/jacob/Netwerkmap cifs auto,iocharset=utf8,uid=jacob,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0
Jacob Vlijm
  • 82,471
  • 12
  • 195
  • 299