Preface
When we need to edit files on the linux server and do not want to log on to the server and use vi for editing, the Samba server is a good tool! The Samba server allows you to create a network ing on windows, and then you can use the sublime editor under wins to edit the changes. The changes will be synchronized to the remote server.
Install the Samba service
Use yum source to install: # yum install samba-client samba-swat
The dependent packages samba-common, samba-winbind-clients, and libsmbclient are automatically installed.
View the installation status:
After the Samba server is installed, the configuration file directory/etc/samba and other samba executable command tools,/etc/samba/smb will be generated. conf is the core configuration file of samba,/etc/init. d/smb is the startup/close file of samba.
Start Samba Server
View samba service startup status
Set auto-start
# Chkconfig -- level 35 smb on // automatically runs the samba service at levels 3 and 5
Configure the Samba service
The main configuration file of Samba is/etc/samba/smb. conf.
The master configuration file consists of two parts:
Global Settings (55-245 rows)
This setting is related to the overall running environment of the Samba service. Its setting items are for all shared resources.
Share Definitions (246-tail row)
This setting is specific to the shared directory and only applies to the current shared resources. (For more information about configuration, see the reference link)
Before using the samba service, you must add existing users to the system to set the samba logon password:
# Sambasswd-a username
Now, you can set the samba configuration to specify the corresponding directory for the User:
This is the samba configuration on my development machine,
The public configuration item is to configure the public shared directory. The ower and group directories in the specified path must be set to nobody to indicate that they do not belong to a user.
[Username] The configuration item is to set the corresponding directory for the user.
After the setting, restart the samba server to take effect. Try connecting to windows:
Now the samba server can be used.