Samba installation and configuration

Source: Internet
Author: User

Samb can be accessed from installation to windows. This content is purely simple to run smb without considering any security issues.

[1] installation:
(1) download smb rpm package file samba-3.0.10-1.4E.11.i386.rpm
(2) run the rpm command to install the rpm-ivh -- nodeps samba-3.0.10-1.4E.11.i386.rpm

[2] adding a user
(1) Add system user useradd shwq
(2) Change the User Password userpasswd shwq
(3) add smb User smbpasswd-a shwq
(4) modify the smb configuration file vi/etc/samba/smb. conf
Modify as follows:
[Xxx]
Comment = xxx work path
Path =/home/xxx
Public = yes
Writeable = yes
Guest OK = yes
(5) disable the Firewall service iptables stop
(6) restart smb service smb restart

[3] Access in window
(1) My computer-> tool-> ing network drive-> // 192.168.0.3/xxx

[4] Successful access to smb

[Note]
1,
[Problem]
Sometimes accessing smb in windows is blocked and cannot be accessed because linux iptables blocks the ports for communication between the two.
[Solution]
1. Disable the firewall and add rules to iptabel.
Vi/etc/rc. d/firewall

Iptables-a input-p tcp -- dport 138-j ACCEPT
Iptables-a input-p tcp -- dport 139-j ACCEPT

 

If the smb configuration is successful but the linux iptables cannot be connected in windows

The correct method is as follows:
[1] disable iptables-F.
[2] Link
[3] If the problem occurs, add information in iptable rules to enable port 139 of smb.
139 is the communication port between windows and linux
[4] in/etc/sysyconfig/iptables
Add the following information:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 138-j ACCEPT
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 139-j ACCEPT

References:
Http://www.lslnet.com/linux/dosc1/04/linux-124771.htm
Http://fanqiang.chinaunix.net/adm/net/2005-03-31/3071.shtml

Automatic smb running
[Solution]
Enter setup on the terminal, select System services, and then select smb on the displayed page. * It indicates that smb can be automatically started.

Test smb Configuration File Syntax

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.