How to mount Windows share on Red Hat Enterprise Linux system using CIFS?

RHE5以后的kernel已经不再支持smbfs,而改用Common Internet File Systemcifs(cifs)取代了原有的smbfs

一:Windows share can be mounted on RHEL system using cifs option of mount command as :
mount –t cifs –o username=<share user>,password=<share passwd>  //win-pc-ip/<share name>  /mnt

二:In case your user is in windows domain then you can define the domain as follows:
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 and file_mode options to set directory and file permission.
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)
Please verify the permission on the folder on you windows machine and try again mount the share folder.

mount error(127): Key has expired
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
原因:帐号的密码过期,将windows帐号的密码改为永不过期。

mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Sep 26 11:04:18 www kernel: CIFS VFS: cifs_mount failed w/return code = -5
原因:已经挂载了,需要先umonut,再mount

此条目发表在Experience, Oprating-System分类目录,贴了, , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注