Samba allows linux to read files in the windows shared folder. first, a software directory is shared on a Windows machine and the access permission of the directory is set. The IP address of the local Windows machine is 192.168.10.58, and then runs the following command on linux: mount-tsmbfs & n, the Linux code, reads files in the windows shared folder through samba.
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mountA problem with cifs "src =" http://s6.sinaimg.cn/mw690/66ac0939gde4ec93950f5&690 "width =" 690 "height =" 101 "/>
First, share a software directory on a Windows machine and set the access permission for the directory. The IP address of the local Windows server is 192.168.10.58.
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mount A problem with cifs "src =" http://s4.sinaimg.cn/mw690/66ac0939g7ca1948c9e53&690 "/>
Then run:
Linux code
Mount-t smbfs-o username = administrator, password = ''// 192.168.10.58/software/share
Or mount-t cifs-o username = administrator, password = ''// 192.168.10.58/software/share
If mount: unknown filesystem type 'smbfs' is prompted, the windows shared disk cannot be mounted because the kernel of RHE5 no longer supports smbfs, and the Common Internet File Systemcifs (cifs) is used instead) replace the original smbfs. therefore, change the smbfs in the original command to cifs.
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mount A problem with cifs "src =" http://s13.sinaimg.cn/mw690/66ac0939g7ca17a83d1fc&690 "width =" 690 "height =" 42 "/>
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mount A problem with cifs "src =" http://s13.sinaimg.cn/mw690/66ac0939gde4ec937481c&690 "width =" 690 "height =" 263 "/>
In this way, you can. If you are prompted that you do not have the permission to write files during the test, run the following command:
Linux code
- Umount/share
- Mount-t smbfs-o rw, fmask = 775, dmask = 777, uid = www, gid = www, username = administrator, password = ''// 192.168.10.58/Software/share
- If umount reports an error: unmount error 16 = Device or resource busy, you need to use the umount-l/var/www/share command to uninstall it. this is the umount lazy mode enabled, detach an object when it is not busy.
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mount A problem with cifs "src =" http://s16.sinaimg.cn/mw690/66ac0939gde4ef6f3fa7f&690 "width =" 690 "height =" 174 "/>
Cifs: "alt =" Linux accesses Windows shared folders. For more information about mount A problem with cifs "src =" http://s15.sinaimg.cn/mw690/66ac0939gde4ef6fa092e&690 "width =" 690 "height =" 97 "/>