Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to quickly configure Samba to map Linux directories to Windows drives

Shulou Source: shulou.com Published: 2022-06-01 06:25:11 09月19日 Update

This article shows you how to quickly configure Samba to map Linux directories to Windows drives, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Operation steps on the Linux server in the local area network:

1. Install samba (CentOS Linux):

Yum install samba system-config-samba samba-client samba-common

2. Create a www account

/ usr/sbin/groupadd www

/ usr/sbin/useradd-g www www

Mkdir-p / data0/knose/

Chmod 777 / data0/knose/

Mkdir-p / data0/htdocs/

Chown-R www:www / data0/htdocs/

Chmod 777 / data0/htdocs/

Cat / etc/passwd | mksmbpasswd.sh > / etc/samba/smbpasswd

3. Create a samba configuration file

Mv-f / etc/samba/smb.conf / etc/samba/smb.conf.bak

Vi / etc/samba/smb.conf

Enter the following:

Quote

[global]

Server string = Samba Server

Security = user

Encrypt passwords = yes

Smbpasswd file = / etc/samba/smbpasswd

[knose]

Workgroup = root

Netbios name = root

Path = / data0/knose

Browseable = yes

Writeable = yes

[web]

Workgroup = www

Netbios name = www

Path = / data0/htdocs

Browseable = yes

Writeable = yes

4. Set a password for samba users www and root:

Smbpasswd-a www

Smbpasswd-a root

5. Start samba:

/ sbin/service smb start

2. Operation steps on the Windows server in the local area network:

1. Visit samba on Windows and type in "my computer":

\\ xxx.xxx.xxx.xxx\

2. Windows disconnects the samba sharing connection, and enter in [start] → [run] → [cmd] enter:

Net use * / del

3. Map the Linux directory of samba share to a drive letter of Windows.

3. Cross-platform Cramp code compilation and debugging:

Use the editor under Windows to write and modify the cross-platform CumberCraft + code. After saving, you don't need to copy it to other places, and you can compile and debug the program at the same time using the gaming +, gcc and gdb under the Visual Studio,Linux under Windows.

Note: it is important to note that executing the ".bat" batch script on a samba shared drive will result in a Windows blue screen.

The above is how to quickly configure Samba to map Linux directories to Windows drives. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Driver directory configuration content input code local area local area network skills server step knowledge service compilation concise concise at the same time place password Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Linux vpn Apple OPPO Reno