Get the App
SLTechnology News&Howtos  ›  Servers  › 

Configuration of samba, ntp, NFS, dhcp, ftp

Shulou Source: shulou.com Published: 2022-06-03 03:35:27 10月31日 Update

1 、 samba

/ etc/samba/smb.conf

[global]

Workgroup = MYGROUP server string = Samba Server Version% v security = user passdb backend = tdbsam load printers = yes cups options = raw

[homes]

Comment = Home Directories browseable = no writable = yes

[printers]

Comment = All Printers path = / var/spool/samba browseable = no guest ok = no writable = no printable = yes

There are three main parts: [global], [homes], [printers].

[global] defines the global configuration, and "workgroup" is used to define the workgroup. I believe that if you have installed windows's system, you will be familiar with this workgroup. In general, we need to change the word "MYGROUP" here to "WORKGROUP" (the default workgroup name for windows).

Security = user # here specifies the security level of the samba. There are four levels of security:

Share: users can log in to the samba server without an account and password

User: the samba server that provides the service is responsible for checking the account and password (default)

Server: another windows or samba server is responsible for checking accounts and passwords

Domain: specify a windows domain control server to verify the user's account and password.

Passdb backend = tdbsam # passdb backend (user backend), samba has three user backends: smbpasswd, tdbsam and ldapsam.

Smbpasswd: this way is to use the smb tool smbpasswd to set a Samba password to the system user (real user or virtual user), and the client uses this password to access Samba resources. Smbpasswd is in / etc/samba, and sometimes you need to create this file manually.

Tdbsam: create a user database using a database file. The database file is called passdb.tdb and is in / etc/samba. The passdb.tdb user database can use smbpasswd-a to create Samba users, and the Samba user to be created must first be a system user. You can also use pdbedit to create a Samba account. There are many parameters for pdbedit, which are listed as follows:

Pdbedit-a username: create a new Samba account.

Pdbedit-x username: delete the Samba account.

Pdbedit-L: list Samba users and read passdb.tdb database files.

Pdbedit-Lv: lists the Samba user list details.

Pdbedit-c "[D]"-u username: suspend the Samba user account.

Pdbedit-c "[]"-u username: restore the Samba user account.

Ldapsam: authenticates users based on LDAP account management. First, set up the LDAP service and set "passdb backend = ldapsam:ldap://LDAP Server"

Two parameters, load printers and cups options, are used to set printer correlation.

In addition to these parameters, there are a few parameters that you need to know:

Netbios name = MYSERVER # sets the hostname that appears in the Network neighbor

Hosts allow = 127.00. 192.168.12. 192.168.13. # used to set allowed hosts. If ";" is preceded by ";", all hosts are allowed

Log file = / var/log/samba/%m.log # defines the log of samba, where% m is the netbios name above

Max log size = 50 # specifies the maximum capacity of the log in K

[homes] this part of the content shares the user's own home directory, that is, when the user logs in to the samba server, he or she actually enters the user's home directory. After the user logs in, the share name is not the homes but the user's own identifier. For a simple file sharing environment, this part can be watched.

[printers] this part of the content sets printer sharing.

2 、 ntp

Related configuration files for NTP

Port number: ipv4 udp 123 (source port: receiving client request),

First deal with the issue of permissions, including the release of upper-layer servers and open sources of LAN users:

Restrict default kod nomodify notrap nopeer noquery

Tags: Users files services configurations systems servers directories data parameters passwords customers clients permissions accounts hosts databases ports identities codes content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia MySQL MariaDB Redmi