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)

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
  • 83,767