Samba (SMB is the acronym) is a network server for Linux and Windows to share files only; Samba which can be used to share files between Windows and Linux, the same used to share files between Linux and Linux.
1. Configure Linux shared path.
vi /etc/samba/smb.conf
edit / etc smb.conf file in / samba directory.
smb.conf contains a plurality of whole cells, the name of each unit is placed in square brackets ([]) in the respective brackets are distinguishable identification elements. The first unit is a [Global], for some global settings for users who are not familiar with the samba, this unit generally not modified. The second unit is a [home], it is the role of linux users can connect to other machines from their home directory. To set a specific shared directory, it is recommended to add a whole unit in smb.conf end of the file. Generally include a few sentences. Here is an example:
[Share]
Comment = the Shared Folder with username and password
path = / Home / ZWQ
Valid Users = ZWQ
public = NO
Writable = Yes
Printable = NO
Create mask = 0765
Description:
Comment: prompt, network neighbors in the windows on display for the notes.
path: a shared directory on linux
valid users: linux allows users to access a shared directory, the user needs is a samba user linux
public: allow guest access
writable: allows the user to write
printable: If set to yes, were identified as printers
create mask: file permissions set up on a shared directory
2. create a user samba
SMB user name, used in the following Windows access. This user must exist in the Linux system user, or "smbpasswd -a" command fails.
-m -s useradd / bin / csh ZWQ
passwd ZWQ
the smbpasswd -a ZWQ
3. restart the SMB service.
/etc/init.d/smbd restart
if the SMB service is not started, do /etc/init.d/smbd start to start.
If you want to start SMB service after a system reboot automatically, please join /etc/init.d/boot.local end of the file in the following two lines:
rcnmb Start
/etc/init.d/smbd Start
4. Access Linux shared in Windows folder.
. a Enter the "Start> Run", "\\ Linux server IP address" to log on to the target server as follows:
b. Specific access to a directory, such as Share, the system will pop-up dialog box, users need to enter the samba (zwq).
Linux systems can access files in the user name and password, user name and password is the above-mentioned increase of samba user name and password.
5. The Linux-Windows shared folder mapped as a local disk partition.
a. Type "cmd" Starting Windows "Start> Run" command line.
b Do net use Q:. \\ Linux server IP address \ Share command to complete the mapping.
c. Open the Windows "My Computer" to see Q disk.
1. Configure Linux shared path.
vi /etc/samba/smb.conf
edit / etc smb.conf file in / samba directory.
smb.conf contains a plurality of whole cells, the name of each unit is placed in square brackets ([]) in the respective brackets are distinguishable identification elements. The first unit is a [Global], for some global settings for users who are not familiar with the samba, this unit generally not modified. The second unit is a [home], it is the role of linux users can connect to other machines from their home directory. To set a specific shared directory, it is recommended to add a whole unit in smb.conf end of the file. Generally include a few sentences. Here is an example:
[Share]
Comment = the Shared Folder with username and password
path = / Home / ZWQ
Valid Users = ZWQ
public = NO
Writable = Yes
Printable = NO
Create mask = 0765
Description:
Comment: prompt, network neighbors in the windows on display for the notes.
path: a shared directory on linux
valid users: linux allows users to access a shared directory, the user needs is a samba user linux
public: allow guest access
writable: allows the user to write
printable: If set to yes, were identified as printers
create mask: file permissions set up on a shared directory
2. create a user samba
SMB user name, used in the following Windows access. This user must exist in the Linux system user, or "smbpasswd -a" command fails.
-m -s useradd / bin / csh ZWQ
passwd ZWQ
the smbpasswd -a ZWQ
3. restart the SMB service.
/etc/init.d/smbd restart
if the SMB service is not started, do /etc/init.d/smbd start to start.
If you want to start SMB service after a system reboot automatically, please join /etc/init.d/boot.local end of the file in the following two lines:
rcnmb Start
/etc/init.d/smbd Start
4. Access Linux shared in Windows folder.
. a Enter the "Start> Run", "\\ Linux server IP address" to log on to the target server as follows:
b. Specific access to a directory, such as Share, the system will pop-up dialog box, users need to enter the samba (zwq).
Linux systems can access files in the user name and password, user name and password is the above-mentioned increase of samba user name and password.
5. The Linux-Windows shared folder mapped as a local disk partition.
a. Type "cmd" Starting Windows "Start> Run" command line.
b Do net use Q:. \\ Linux server IP address \ Share command to complete the mapping.
c. Open the Windows "My Computer" to see Q disk.
After the set can not be found in the new file under windows, mostly want to / home / zhangyi / public authority to 777
b Do net use Q:. \\ Linux server IP address \ Share command to complete the mapping.
Note: net use Q: \\ 192.168.40.41 \ public-zhangyi
net use Q: \\ 192.168.40.41 \ followed by the name of the shared folder
See the name of the shared folder
vi /etc/samba/smb.conf the red part
[public-zhangyi]
comment = zhangyi Public
path = /home/zhangyi/public
browseable = yes
read only = no
guest ok = yes
available = yes
comment = zhangyi Public
path = /home/zhangyi/public
browseable = yes
read only = no
guest ok = yes
available = yes
You can also perform net view \\ 192.168.40.41 in cmd
Share Name Type Use the comment
-------------------------------------------- ----------
Linux Linux data the data Disk
liulei Disk Liulei Share
public public Disk
public-liulei LiuLei public Disk
public Disk yanghansen public-yanghansen
public-zhangyi zhangyi public Disk
command completed successfully.
-------------------------------------------- ----------
Linux Linux data the data Disk
liulei Disk Liulei Share
public public Disk
public-liulei LiuLei public Disk
public Disk yanghansen public-yanghansen
public-zhangyi zhangyi public Disk
command completed successfully.
10 map the remote share:
NET use z: \\ IP \ baby
This command will share a shared resource called baby mapped to z disk
NET use z: \\ IP \ baby
This command will share a shared resource called baby mapped to z disk
---------------------
Author: chilled latte
Source: CSDN
Original: https: //blog.csdn.net/stu059074244/article/details/77766155
copyright Disclaimer: This article is a blogger original article, reproduced, please attach Bowen link!