This is the second day of my participation in the November Gwen Challenge. Check out the details: the last Gwen Challenge 2021
In the project encountered Linux system need to mount Windows directory requirements, this paper records the implementation method.
Windows System Settings
Enabling the SMB Service
Open the Control Panel -> Programs and Features -> Enable SMB 1.0/CIFS file sharing support -> Restart the computer
Setting a Shared Folder
Folder to share -> Right-click properties -> Share -> Share Settings -> Add Everyone user -> Set permissions for this user
After configuring share Settings, you can view the shared directory on the network:
On your Windows system, the directory network path is \\ computer name \ pathname. Users on other networks can also use this address to access your shared content:
Set whether a password is required for a share
Open control Panel -> Network and Sharing Center -> Advanced Sharing Settings -> All Networks -> Configure password-protected sharing
An error repair
Error mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
- In this case, you can cancel the password requirement (change to the share without password protection) and check whether the file can be mounted successfully
- Change local policy:
- CMD enter gpedit. MSC to enter the local computer policy
- Computer Configuration = Windows Settings = Security Settings = Local Policies = Security Options = Network Access: Sharing and security models for local accounts
- Instead of
classic
Can be
Firewall Settings
Firewalls can be turned off in scenarios where security can be sacrificed for availability
- If the firewall is not disabled, an error may be reported:
mount error(115): Operation now in progress
Copy the code
The solution
-
Disabling the Windows Firewall
-
Do not disable the firewall. IP permit Settings for Samba in file and printer sharing in Setting firewall inbound rules
Control Panel/System and Security /Windows Firewall/Advanced Settings/Inbound rules/File and Printer Sharing (SMB-IN) Public/Properties/Scope/Remote IP
Change from local subnet to any IP
Linux Settings
Installing related packages
sudo apt-get install nfs-common
sudo apt-get install smbfs
sudo apt-get install cifs-utils
Copy the code
Run the mount command
Before mounting, you need to manually create a folder. The command cannot be automatically created
$Sudo mount -t cifs -o username=Everyone //10.0.2.19/temp win_disk/
Copy the code
Note: the \\ computer name \ pathname address on Windows is not good for Linux mounting, so you need to change the computer name to the IP address of the Windows computer.
The resources
- Ask.hellobi.com/blog/safa/3…