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.