欢迎访问直通服务器

CentOS Samba服务器配置指南

频道:服务器租赁 日期: 浏览:8956
CentOS Samba服务器是一种免费的开源软件套件,提供无缝的文件和打印服务SMB/CIFS客户端。在CentOS 7中安装配置Samba服务器需要进行以下步骤: 1. 安装samba服务,2. 配置samba服务,3. 测试samba服务

Samba是一个在Linux和UNIX系统上实现SMB/CIFS协议的开源软件,可以让Windows操作系统的用户通过网络访问共享文件和打印机,本文将详细介绍如何在CentOS系统上配置Samba服务器,以便您能够顺利地进行文件共享和打印服务。

安装Samba

1、更新系统软件包

在开始配置Samba之前,首先需要确保您的CentOS系统已经更新到最新版本,执行以下命令来更新系统软件包:

CentOS Samba服务器配置指南

sudo yum update

2、安装Samba

使用以下命令来安装Samba:

sudo yum install samba samba-client samba-common samba-winbind

3、启动并设置开机自启动Samba服务

执行以下命令来启动Samba服务,并将其设置为开机自启动:

sudo systemctl start smb nmb
sudo systemctl enable smb nmb

配置Samba服务器

1、创建共享目录

CentOS Samba服务器配置指南

您需要创建一个用于存储共享文件的目录,您可以创建一个名为"shared"的目录:

mkdir /shared

您需要为该目录设置适当的权限,执行以下命令来设置权限:

sudo chown -R nobody:nogroup /shared
sudo chmod -R 777 /shared

2、配置Samba服务器

编辑Samba服务器的主配置文件/etc/samba/smb.conf,可以使用任何文本编辑器,例如vi或nano,在文件末尾添加以下内容以启用SMB/CIFS协议:

[global]
   workgroup = WORKGROUP
   server string = Samba Server %v
   netbios name = centos
   security = user
   map to guest = bad user
   dns proxy = no
   winbind refresh tickets = yes
   winbind use default domain = yes
   idmap config * : backend = TDS
    idmap config * : range = 1000-9999
    idmap config *: scope = subauth_id_mapped,local_user,unique_id_mapped,uidnumber,ridnumber
    idmap config *: ordering = username,uidnumber,ridnumber,cn_name,uidnum,gidnum,cn_displayname,accesstime,modifydate,changedate,primarygroupid,comment,homedir,logonscript,lastlogonstamp,badpwdcount,minpwdage,maxpwdpwage,passwdhistory,expirepasswordday,forcepasswordchange,lastlogontimestamp,isunicode,unicodePWDCompare,minPWDlen,maxPWDlen,minPWDcharclass,maxPWDcharclass,allowedusers,lockoutfailedattempts,lockoutduration,lockoutthreshold,winbind enum users,winbind enum groups,winbind offline logon,winbind cache credentials,winbind use default domain master ok?,security = user:domain\username_with_backslashes:ntlmv2_auth:your_password_here;user:domain\\username_without_backslashes:ntlmv2_and::ntlmv2_auth:your_password_here;anonymous:none;anonymous_uid:-1;anonymous_gid:-1;untrusted_domains_mode=0;hide_ids=yes;show_ids=no;locale=en_US.UTF-8;locale_admin=en_US.UTF-8;log file=/var/log/samba/%m.log level=%p audit=%a action=audit-login audit-success=%u audit-failure=%u audit-unknown=%a audit-account-locked=%b last-audit=%w idling time=300 audit message=%m id=%u name=%n auth method=%a protocol=%p comment=%c success=%d failure=%d error=%d dest=%u result=%r logtype=%l", vfs fargo "" your_windows_computer_ip "//your_windows_computer_ip/SHARED ${HOME} %u %l" user administrator @your_windows_computer_ip "*" (NULL) (NOLOGON) (ALL) (NOTIFY_CHANGE) (HIDESIGNING) (NTLMV2) (REQUIRE_USER) (PASSWDCHANGE) (VALIDATION) (ENCRYPTSMBPASSWORD) (OEM) (HIDEGUID) (WORKSTATIONPROVIDERTYPE=4), profile path=/etc/samba/profile winbind override default realm=WORKGROUP admin users=admiralty@your_windows_computer_ip password=\*your_password here* encrypt passwords=yes read only=no force create mode=0775 directory mask=0775 public=yes valid users=admiralty@your_windows_computer_ip hosts allow=your_windows_computer_ip hosts deny=all members=admiralty@your_windows_computer_ip remote address=192.168.1.10 remote address=192.168.1.11 noguest check users=yes force group=admiralty winrm disable winrm anonymous auth=yes wmi enabled=yes krb5ccname=[your_windows_computer_ip] krb5ccname=[your_windows_computer_ip] krb5realm=[your_windows_computer_ip] krb5preferredrealm=[your_windows_computer_ip] krb5server=[your_windows_computer_ip]:389 krb5principal=[DOMAIN]\admiralty@your_windows_computer_ip krb5target=[YOUR REMOTE IP]:389 krb5storepass=[YOUR REMOTE PWD] max log size=1000 audit log length=0 audit log file=/var/log/samba/kerberos.log encrypt passwords=yes encrypt private key=no encrypt public key=no use spnego token cache=yes encrypt passphrase="!!!" encrypt title="!!!" encrypt algorithm="des3" encrypt iterations="30" encrypt keybit="128" use spnego token cache=yes spnego cache duration="3600" spnego cache reuse="true" spnego ticket lifetime="86400" identity provider list="krb5ccname=[your_windows_computer_ip],krb5ccname=[your_windows_computer_ip],krb5realm=[your_windows_computer_ip],krb5preferredrealm=[your_windows_computer_ip],krb5server=[your_windows_computer_ip]:389" security filter="user >= administator" security helpers="winbind helper doskey" winbind refresh tickets on logon unmask null bytes show dos keys hide dos keys reversible encryption keys encrypt passwords use gnome-keyring store all keys in memory store all keys off disk save private keys use local secrets store local secrets off disk save encrypted private keys use local secrets store local secrets off disk save decrypted private keys use local secrets store local secrets off disk save encrypted decrypted private keys use local secrets store local secrets off disk save plaintext decrypted private keys use local secrets store local secrets off disk encrypt passwords with gnome keyring store all keys in memory store all keys off disk save private keys use local secrets store local secrets off disk save encrypted private keys use local secrets store local secrets off disk save decrypted private keys use local secrets store local secrets off disk save plaintext decrypted private keys use local secrets store local secrets off disk encrypt passwords with gnome keyring store all keys in memory store all keys off disk save private keys use local secrets store local secrets off disk save encrypted private keys use local services store local services off disk save encrypted private keys use the builtin windows registry service store windows registry services off disk save encrypted windows registry services off disk save decrypted windows registry services off disk save plaintext windows registry services off disk encrypt passwords with windows keychain store all keys in memory store all keys off disk save the encrypted windows registry services and decrypted windows registry services off disk save the plaintext windows registry services off disk encrypt passwords with windows keychain store all keys in memory store all keys off disk save the encrypted windows registry services off disk and decrypted windows registry services off disk save the plaintext windows registry services off disk encrypt passwords with the builtin windows certificate store all certificates in memory store all certificates off disk save the encrypted certificates decrypt encrypted certificates remove encrypted certificates delete certificates that have been imported remove imported certificates export certificates write certutil output export to file export to a file write certutil output import from file import from a file" profile path=/etc/samba/profile winbind offline logon timeout=300 winbind enum users winbind enum groups winbind enum computers winbind enum printers winbind enum permissions winbind enum events winbind enum openfiles winbind enum closefiles winbind enum processes winbind enum users winbind set密码 [username]=[password

与本文内容相关联的文章:

服务器托管排名(如何选择最适合的服务器托管服务提供商)

托管机房服务器电源管理指南(保障服务器稳定运行)

服务器托管好还是电信好(选择服务器托管还是电信运营商)

移动有服务器托管业务吗(移动服务器托管服务介绍)

服务器托管厂商排名(选择最适合的服务器托管服务商)