Use samba to allow linux to read files in windows shared folders

Source: Internet
Author: User
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
  1. Umount/share
  2. Mount-t smbfs-o rw, fmask = 775, dmask = 777, uid = www, gid = www, username = administrator, password = ''// 192.168.10.58/Software/share
  3. 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 "/>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.