every time you configure samba for the new server, you need to review the information or access the Internet, and finally make up your mind to write down some key points for use from time to time.
1. Install Samba: generally, the Samba server is installed by default in Linux. The current version is 3.0. If not, you can install Samba online in the same way as the RPM package or yum-y install Samba.
2. Configure/etc/samba/smb. conf, which can be configured properly. A simple example is as follows:
[data]
Path =/Data
Public = Yes
writeable = Yes
note: do not forget to set the security level
# security mode. most people will want user level security. see
# security_level.txt for details.
Security = user
3. Add a samba user
smbpasswd-A centospub guest to add user1 (example) to the samba user database.
New smb password: Login enter the password used by the user to log on to Samba
Retype new smb password: Confirm again to enter the password
Added user user1.
4. Check the Firewall
Before starting the samba service, open the port used by Samba in the firewall settings. The port number is 139,445.
VI/etc/sysconfig/iptables ← edit iptables configuration file
Add the following lines
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 139-J accept
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 445-J accept
-A RH-Firewall-1-INPUT-p udp-m udp -- dport 137-J accept
-A RH-Firewall-1-INPUT-p udp-m udp -- dport 138-J accept
/Etc/rc. d/init. d/iptables restart iptables to make the new rule take effect
Flushing firewall rules: [OK]
Setting chains to policy accept: Filter [OK]
Unloading iptables modules: [OK]
Applying iptables firewall rules: [OK]
5. Start the Samba server
Chkconfig SMB on startup
/Etc/rc. d/init. d/SMB start restart start SAMBA service
Starting SMB services: [OK]
Starting nmb services: [OK]
try to ping the Host Name of the server from the Windows client, and then use start \ gaplinux to access Linux Server resources.