https://access.redhat.com/solutions/448263
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
Issue
- How can Windows shares be mounted on Red Hat Enterprise Linux?
Resolution
- Windows share can be mounted on RHEL system using
cifs
option ofmount
command as :
[root@host ~]# mount -t cifs -o username=<share user>,password=<share password> //WIN_PC_IP/<share name> /mnt
- In case your user is in windows domain then you can define the domain as follows:
[root@host ~]# mount -t cifs -o username=<share user>,password=<share password>,domain=example.com //WIN_PC_IP/<share name> /mnt
- By default windows share mounted with the full permission (777) in Linux. To change the default permission use the
dir_mode
andfile_mode
options to set directory and file permission.
[root@host ~]# mount -t cifs -o username=<share user>,password=<share password>,dir_mode=0755,file_mode=0755 //WIN_PC_IP/<share name> /mnt
- To make the mount persistant across reboots, make the below entry to the
/etc/fstab
//WIN_PC_IP/<share name> /<mntpoint> cifs _netdev,username=<share user>,password=<share password>,dir_mode=0755,file_mode=0755,uid=500,gid=500 0 0
- If you receive the following error when try to mount the share folder from windows machines
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Example:
1.checking the mounted file systems: mount | column -t | grep mnt
2. create a folder in 172.29.65.205, and share the folder.example : Test_dd
3. login as root
3. login as root
4. issue command : mount -t cifs //177.11.11.111/Test_dd -rw -o username=e_kkkl,password=Password /mnt/MD5
5. un-mount it : umount /mnt/MD5
5. un-mount it : umount /mnt/MD5