How to configure a samba Server

Source: Internet
Author: User
Article Title: Teach you how to configure a samba server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

# Rpm-q samba // check whether SAMBA is installed. If it is not installed, perform the following installation:

# Rpm-ivh squid-2.5.STABLE1-2.i386.rpm

# Vi/etc/services // check whether services starting with netbios are available. All services must be available.
// Disable the linux Firewall
# Ls/etc/samba // No smbpasswd file

# Smbpasswd-a tom // create a tom user

# Ls/var/log/samba // log file of the smb server

# Vi/etc/samba/smb. conf // edit the master configuration file of the smb server

Workgroup = WORKGROUP // windows Workgroup name

Server string = samba server // samba server brief description

Hosts allow = 192.168.1. 192.168.0. 127. // you can specify the subnet to be accessed. All subnets are allowed by default.

Hosts allwo = client1, alarm.com, 192.168.16. Random t 192.168.16.4 // example

Security = user // sets the security level. The default value is user. The five levels are share, user, server, domain, ads"

Interfaces = eth0 // multiple NICs SAMBA server sets the NIC for listening

Interfaces = 192.168.16.177/24 // example

Wins support = yes // set to use the samba server as the wins server, which is not used by default.
// The wins server is developed by Microsoft to convert the NetBIOS name to the corresponding IP address.
Username map =/etc/samba/smbusers // remove the previous; sign for user ing

Edit the/etc/samba/smbusers file and add the user to be mapped. The format is

Independent linux users = List of windows users to be mapped

For example, test = alarm back // test corresponds to the alarm and back users in windows.

Encrypt password = yes or no // yes indicates that the password is encrypted and no indicates that the password is not used.

If this option is no, the windows system must respond to the modify Registry key, the Registry file is stored under/usr/share/doc/samba-2.2.7a/docs/Registry

[Homes] // set the shared directory
Comment = Home Directories // brief description
Browseable = no // whether to allow users to browse the home directory of all users
Writable = yes // whether to allow users to write data to their home directory

[Share] // set a shared directory
Comment = Samba's share Directory // brief description
Read list = test // read-only users or groups
Write list = @ share // writable user or group
Path =/home/share // path of the shared folder directory

// Perform the following operations after setting the shared directory

1. Log On As the root user, run groupadd share to create a share group, and run usermod-g share abc to add the abc user to the share group.

2. Create a directory share under/home.

3. chown: share/home/share: Set the share directory to the share group. chmod 777/home/share sets the share group to have the maximum permission on this directory.

: Wq // save and exit

# Testparm // test whether the smb. conf file has a syntax error

# Su-// switch the root user

# Service smb start | restart | stop // start | restart | stop the samba server

# Ntsysv // set samba server startup

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.