statement
- Normally, when using the Samba service of the Linux server to map the network drive in Windows, the general default is to directly fill in the ip of the Linux server on the internal network, and it will default to port 445.
- What should I do if my windows is not on the same network segment as the Linux server?
1 Open CMD with an administrator account to check the occupation of port 445
netstat -ano | findstr 445
It is the process with pid 4 to monitor.
2 Disable the server service
Right-click Computer – Manage – Services and Applications – Services, find the service named Server, double-click to open the properties, and change the startup type to Disabled.
3 Restart the computer and check the 455 port occupation again
netstat -ano | findstr 445
Shown as unoccupied.
4 Modify port forwarding
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=445 connectaddress=$(smb服务器的IP地址或绑定的域名) connectport=$(smb服务器的端口号)
5 Check if the port forwarding is successful
netsh interface portproxy show all
It can be displayed as follows:
6 Mapping a network drive
When mapping the network drive, fill in 127.0.0.1 to map to the Samba service of the Linux server.
7 Complete the mapping
The network drive mapped in windows is as follows: