These days we tried to mount a shared folder on RHEL5 but always got below error:
[root@olinux511 /]# mount -t cifs -v -o guest,ro //192.168.56.1/Tools /tmp/test mount.cifs kernel mount options: unc=//192.168.56.1\Tools,ip=192.168.56.1,user=root,ver=1,ro,guest mount error 13 = Permission denied Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
It was clear that the issue was about permission, and in fact it is about how to create a shared folder and allow other clients to access the shared folder without the username and password.
I could not believe it took me several hours to make it work!
Most posts are similar with below one:
But after I followed the steps one by one I just found it did not work for me, so I had to do more research and tests to get the workable solution.
Below is my final summary and I hope it could be helpful for others.
- Enable the Guest account
- Turn off the 'Password-protected Sharing'
- Grant the needed permissions on the target folders to the Guest user, and also add them to the 'Share permissions'.
- Remove the Guest user from the 'Deny access to this computer from the network'.
After these settings, I could mount it without password finally.
[root@olinux511 /]# mount -t cifs -v -o guest,ro //192.168.56.1/Tools /tmp/test mount.cifs kernel mount options: unc=//192.168.56.1\Tools,ip=192.168.56.1,user=root,ver=1,ro,guest [root@olinux511 /]# mount /dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/sda1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) /dev/sdb1 on /oracle type ext3 (rw) /dev/sdc1 on /oracle/oradata type ext3 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) //192.168.56.1/Tools on /tmp/test type cifs (ro,mand) [root@olinux511 /]# umount /tmp/test