Mount Windows share with the Smbmount command under Linux

Source: Internet
Author: User

Between Windows operating systems, you can map a shared directory into a disk file system by mapping a network drive, and under Linux, you can use the Smbmount command to implement a similar function that mounts a shared directory of Windows under a directory under Linux.

Test Platform:

Red Hat Enterprise Linux as Release 3 (Taroon)

Windows Advanced Server SP4

Current test Condition:

1, Windows and Linux are in the same LAN, can ping each other, no firewall set up

2, the IP address of Windows: 192.168.60.188

3, Linux IP address: 192.168.60.189

4, Windows currently has the following shares: C$,temp (everyone has Read permissions)

5, Windows users have CMW (Admin Group user account), GRP (Admin Group user account), guest (not currently enabled), no root account

6, Linux installed on the relevant RPM package: Samba-client, it is the Samba client tool, you can use the Smbmount command after installation

The basic testing process is as follows:

Syntax: Smbmount//IP address/share name mount point-O option 1, option 2 ...

1, Mount C $ share:

[Root@rh root]# smbmount//192.168.60.188/c$./c$-O username=cmw

Password:

[Root@rh root]# CD C $

Or:

[Root@rh root]# smbmount//192.168.60.188/c$./c$-O USERNAME=CMW,PASSWORD=CMWW

Lovegrp

[Root@rh root]# CD C $

2. Mount Temp Share (Enable Guest account)

[Root@rh root]# smbmount//192.168.60.188/temp./temp

Password:

[Root@rh root]# CD temp/

[Root@rh temp]# ls

Samba webmin-1.260.tar.gz

At this point, the account and password are not specified, then the environment variable user is used as the account number, and the environment variable passwd is used as the password because Windows has enabled the Guest account and the temp share is allowed to be read by anyone, so this command runs successfully

[Root@rh root]# umount./temp

Uninstalling the Network File system

3. Mount Temp Share (Guest account not enabled)

[Root@rh root]# smbmount//192.168.60.188/temp./temp

Password:

Anonymous Login Successful

2068:tree Connect failed:errdos-errnoaccess (Access denied.)

SMB Connection Failed

At this point, the Guest account is deactivated, so the connection fails.

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.