On the server (sharing) side : right click on folder you want to share (e.g Documents) then click properties :
![enter image description here](https://i.stack.imgur.com/3MNvd.jpg)
Enable sharing option (nautilus will download and install samba for you). You may also need to check access for guests.
On the client side :
sudo apt-get install cifs-utils
and mount it (as guest) :
sudo mount -t cifs -o guest //sharing_machine_ip/Documents /mountpoint
you can also add some other options like user and password:
sudo mount -t cifs -o username=your_username,password=your_password //sharing_machine_ip/Documents /mountpoint
If you want this to automount (as guest - indicates you don't need a password to access the share) at startup you can add to the end of /etc/fstab:
//sharing_machine_ip/Documents /your_mountpoint cifs guest 0 0
or with password protected share:
//sharing_machine_ip/Documents /your_mountpoint cifs username=your_username,password=your_password 0 0
I recommend you use fstab
for mounting.
Try to check the logs to troubleshoot the causes of your problem, try this command to display the list of files which could display the mount logs:
grep -e mount -e ext4 -lR /var/log 2> /dev/null
For me, the mount logs were in /var/log/syslog
it may be different for you.
Now you need two terminal tabs open, enter the command on one tab: sudo tail -f /var/log/syslog
And on the second tab, try to mount the system with the following command:
mount -t cifs -o user=USER,domain=DOMAIN,cruid=USER,sec=krb5 //HOST/Share /mnt/tmp
If you go back to your first tab you should be able to see some log errors.
For me the errors were(for you it may be different):
kernel: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
kernel: CIFS VFS: protocol revalidation - security settings mismatch
kernel: CIFS VFS: session ffff90a6a2959000 has no tcon available for a dfs referral request
kernel: CIFS VFS: cifs_mount failed w/return code = -5
Depending on your error logs, you may be able to get away with adding vers=1.0
to your mount command and this could work but it is the less secure version of smb. Otherwise, you could workout what the solution is based on the error you get.
What you could also try is configure the Samba server inside /etc/samba/smb.conf similar to this (it works for me):
[username]
comment = Username's developer directory
read only = no
locking = no
path = /var/www/username
guest ok = no
writeable = yes
Then on the client, add the following line to /etc/fstab
//server/username /mountpoint cifs vers=1.0,username=username,iocharset=utf8,uid=your_profile_uid_on_the_server 0 0
Use sudo mount /mountpint
See how this goes, hopefully this information will be useful to you.
Best Answer
You can disable the entry in
/etc/fstab
and issue the following commandand at the same time play around with different options (behind -o). If you need feedback from you system, you might open a second terminal windows and type
journalctl -fb
to watch how the kernel reacts on your options given.I explain all this because your real issue might be different with cifs than it was in my case.
I had the problem that the device offering SMB wants
ver=1.0
. While Ubuntu 17.04 didn't have any problems with the version (auto), the 17.10 and its kernel demands to indicate the number, as my Kernel logs shows:My Good luck!