Set samba in linux to share windows

Source: Internet
Author: User
Set samba in linux to provide windows sharing-Linux Enterprise Application-Linux server application information. For more information, see the following. First, start the samba service and make sure that it is automatically started when linux is started.

I use centos5.2. samba is installed by default. The installation directory is/etc/samba.

There are two configuration files: smb. conf and smbusers. The main modifications are also in these two files. In addition, passdb. tdb for logging passwords does not need to be set manually.

Create a samba User:
Because we set "user" as the Authentication mode, this account must exist in the linux system account.

First, create a new user (linux User), such as linuxsmb, account directory/home/linuxsmb. The account can operate its own user directory, so sharing is also set in this directory. Otherwise, if it is set to another user directory/home/user1 or another directory, there is a problem where the user is not authorized to perform operations during windows sharing.

Then create a samba User: smbpasswd-a linuxsmb

Set the shared password.

Then open the smbusers file and you will see a line added to the file linuxsmb = linuxsmb

Then modify the smb. conf file:

Set the workgroup and server information in [global:
Workgroup = mygroup
Server string = Samba Server Version % v

The shared directory settings are generally in the last part of the file:
[Smbtest] // shared name, which can be any
Path =/home/linuxsmb // shared directory, which should be the directory that the linuxsmb user has the right to operate
Writeable = yes // write permission
Browseable = yes // visible
Guest account = linuxsmb // user access account

Restart samba to make the settings take effect.

Access sharing in windows, such as // 192.168.1.100 (samba Server ip address), requires entering the username and password of the samba account. Here, we enter the username and password of the linuxsmb account. If the access is successful, the setting is successful.

Smbpasswd operations on samba accounts:
Smbpasswd-a USERNAME to add users
Smbpasswd-x USERNAME delete user
Smbpasswd-d username disabled user
Related Article

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.