[Original] configure Samba On Debian 9

Source: Internet
Author: User
Tags syslog

Samba Overview

Samba is a set of applications that use the SMB protocol. By supporting this protocol, Samba allows communication between Linux servers and Windows systems, making cross-platform mutual access possible. Samba adopts the C/S mode. The working mechanism is to run NetBIOS (the communication protocol of Windows Network neighbors) and SMB on the TCP/IP communication protocol, moreover, the netbeui protocol is used to allow windows to browse Linux servers in "Network neighbors.

The Samba server contains two background applications: smbd and nmbd. Smbd is the core of Samba. It is mainly responsible for establishing conversations between Linux Samba servers and Samba clients, verifying user identities and providing access to file and print systems; nmbd is mainly responsible for releasing the NetBIOS Name and browsing services available for the Linux Samba server, so that Windows users can browse the resources shared by the Linux Samba server in "Network neighbors. Samba also includes some management tools, such as SMB-client, smbmount, testparm, smbpasswd, and other programs.

The Samba server provides the following functions: wins and DNS services, network browsing services, authentication and authorization between Linux and Windows domains, Unicode Character Set and domain name ing, and Unix sharing of CIFS protocols.

 

 

Preparations

[Update system]

No, he just wants to use the latest one.

apt update && apt upgrade

 

 

1. Install samba

Https://www.samba.org/

Command process:

apt install -y samba

 

 

2. Create a user

2.1 create a system user group

groupadd samba

 

 

2.2 create a system user

Create a user that cannot log on to the system and add it to the samba group.

useradd -g samba -M -s /sbin/nologin admin

 

2.3 set the System user password

passwd admin

 

2.4 set Samba User Logon Password

This password needs to be set separately for logging on to SMB. It can be the same or different from the user's system password.

smbpasswd -a admin

 

 

3. Create a directory

3.1 create an exclusive user directory

 

mkdir /home/admin

 

 

2. Delete metadata.

mdadm --zero-superblock /dev/sdb

 

 

 

AppendixCommon commands

 

; ====================================== Global settings ====================== ========= [Global] workgroup = workgroup; working Group Name Server String = Samba server version % v; simple description of the host DNS proxy = nolog file =/var/log/samba/log. % m; Name of the generated log file. The default value is Max log size = 1000, which is the visitor's IP address. The maximum log file capacity is 50 by default. The unit is kb, 0 indicates that syslog = 0 panic action =/usr/share/samba/panic-Action % dserver role = standalone serverpassdb backend = tdbsamobey Pam restrictions = yesunix Password Sync = yespasswd program =/ usr/bin/passwd % upasswd chat = * enter \ snew \ s * \ spassword: * % N \ n * retype \ snew \ s * \ spassword: * % N \ n * password \ supdated \ ssuccessfully *. pam password change = yesmap to guest = bad userusershare allow guests = yes; ==================================== share definitions ======================== ======== [Guest] Comment = guest directories; shared Description: Path =/home/guest is displayed when you hover the cursor over the directory. The shared directory path browseable = yes/no is displayed. You can specify whether the shared directory can be viewed. If no, the shared directory is hidden, access writable = yes/no through IP address + shared name; set whether share has write permission read only = yes/no; set whether share has read-only permission Valid users = username; set users that are allowed to access Shared items, such as valid users = user1, user2, @ group1, @ group2 (multiple users or groups are separated by commas, @ group indicates group user group) Write list = username; set to share users with write permissions, such as write list = user1, user2, @ group1, @ group2 (multiple users or groups are separated by commas, and @ group indicates the group user group) invalid users = username; set public = yes/no; set whether to allow anonymous access to guest OK = yes/no; the function is the same as the public create mask = 0700; the created File Permission is 700 directory mask = 0700, And the Created directory permission is 700.

 

 

 

 

Chmod-r 666/home/guest

# Chmod 2775/home/samba/guest/
# Chmod 2770/home/samba/demo/

 

 

 

 

 

 

[Global] workgroup = workgroupserver string = I fuck your uncle DNS proxy = nolog file =/var/log/samba/log. % mMax log size = 1000 syslog = 0 panic action =/usr/share/samba/panic-Action % dserver role = standalone serverpassdb backend = tdbsamsecurity = usermap to guest = bad user
[Guest] Comment = guest directories Path =/home/guest/Public = Yes read only = Yes
[Demo2] Comment = demo directories Path =/home/demo/Public = no valid users = demo, admin write list = demo writable = Yes

[Original] configure Samba On Debian 9

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.