Samba Server Configuration

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.