问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

redhat enterprise 如何配置samba服务器

发布网友 发布时间:2022-05-02 23:26

我来回答

1个回答

热心网友 时间:2022-04-12 11:26

/etc/samba/smb.conf主配置文件,此文件中有丰富的说明注释
使用smbpasswd命令使Linux系统用户成为Samba用户,命令格式如下:
smbpasswd –a 用户名

SMB.CONF具体实例
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not many any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = Workgroup ;计算机所在的工作组名或域名
netbios name = fileserver ;即在,网上邻居中显示的计算机名
# server string is the equivalent of the NT Description field
server string = Samba Server ;计算机描述

This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
; hosts allow = 192.168.1. 192.168.2. 127. ;允许访问的计算机的IP地址
; hosts allow = 172.16.0. 172.16.3. 127.
# if you want to automatically load your printer list rather
# than setting them up indivially then you'll need this
; printcap name = /etc/printcap加载打印机的配置路径
load printers = no是否将打印机共享

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
; printing = cups一种打印驱动模式,即LINUX支持的标准打印类型。其LINUX支持的打印类型有bsd, sysv, plp, lprng, aix, hpux, qnx

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = nobody
guest account = guest ;允许访问(不需要用户名与密码)也可以指定任何系统内置的一个帐号做为来宾帐号。
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log.会给用户在此目录下做每个SAMBA用户登录的日志。

# Put a capping on the size of the log files (in Kb).
max log size = 50日志 文件*在50K内

# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = share
; security = user
# Use password server option only with security = server
; password server = <NT-Server-Name>此行的作用为如果上面的选项为SERVER,则SAMBA服务器在做身份识别的时候,把WIN机器发过来的密码同用户名交给此项设定的密码服务器验证。

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
; password level = 8
; username level = 8(对于从前的几款老式的WINDOWS系统对于大小写密码支持的不是很好,所以开启上面的两个参数的意义是在密码为8位的用户名与密码的帐号里自动匹配所有的大小写测试)

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes(加密明文的SAMBA密码进行发送)
smb passwd file = /etc/samba/smbpasswd验证密码所在的目录

# The following are needed to allow password changing from Windows to
# update the Linux sytsem password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes把该服务器配置为WINS服务器

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = 192.168.1.100也可以指定一个WINS服务器,让自己成为WINS客户

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes(针对老式计算机,不用设置)

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no(针对老式计算机,不用设置)

# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
; preserve case = no
; short preserve case = no
# Default case is normally upper case for all DOS files
; default case = lower
# Be very careful with case sensitivity - it can break things!
; case sensitive = no
(整个上面这段为讨论与WINDWOS文件系统的大小写问题因为微软的系统是一个大小写不区分 的系统,默认用默认值即可。因为修改可能造成与WINDOWS的不兼容问题)

#============================ Share Definitions ==============================
[homes]作为登录用户,自己访问自己目录的设置。
; comment = Home Directories目录说明
; browseable = no用户私人目录不需要给别人浏览。
; writable = yes也可以用read only=no来替代

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]域用户登录目录设置。
; comment = Network Logon Service
; path = /home/netlogon
; guest ok = yes
; writable = no
; share modes = no

# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /home/profiles
; browseable = no
; guest ok = yes

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each indivial printer
[printers]打印机共享
comment = All Printers说明共享全部打印机
path = /var/spool/samba打印机池,用户必须手工创建该目录。
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = no
writable = no
printable = yes用户是否可以打印

# This one is useful for people to share files
;[tmp]
; comment = Temporary file space
; path = /tmp
; read only = no可以写入
; public = yes即目录是否共享给来宾帐号。

# A publicly accessible directory, but read only, except for people in
# the "staff" group
[public]
comment = Public Stuff
path = /home/soft
public = yes
guest ok = yes以上两个public=yes代表来宾帐号能访问此共享目录,但guest ok代表密码不是必须的,可以不加。
writable = yes
printable = no
write list = @staff此参数告诉我们不必要让所有人访问共享目录,可以有staff这个组的成员能访问,但在passwd和shadow文件中要存在这个组。

# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn](设置仅供一人使用的共享打印机)
; comment = Fred's Printer;
valid users = fred
; path = /homes/fred
; printer = freds_printer
; public = no
; writable = no
; printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir] (为创建一个私有目录,别人都不能访问,只有fred这个用户能访问)
; comment = Fred's Service
; path = /usr/somewhere/private
; valid users = fred
; public = no
; writable = yes
; printable = no

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %u option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
; comment = PC Directories
; path = /usr/pc/%m
; public = no
; writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
; path = /usr/somewhere/else/public
; public = yes
; only guest = yes
; writable = yes
; printable = no

# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]这个例子是配置一个仅供两个用户访问的目录
; comment = Mary's and Fred's stuff
; path = /usr/somewhere/shared
; valid users = mary fred
; public = no
; writable = yes
; printable = no
; create mask = 0765

最后建议在图形界面配置比较简单
在LINUX提示符下输入startx
即可进入图形界面 和WINDOWS差不多 窗口化的配置比较直观也比较简单
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
中国人发源于哪里 "中国人"这个名字的由来 微博关注取消会被发现吗? ...守护甜心》等……带点魔法的变身动画片!拜托!!! 跪求:位,字节,字,双字的解释,和关系。最好举例说明例如:VD100_百度知... 电脑的工作原理?为什么数据可以记录信息(如图片) 新风为什么要保温 新风系统为什么要保温 几年的教师资格转事业编制 ay89s51单片机可以用串口下载程序吗? 想买一款润滑液,杜蕾斯好不好? 杜蕾斯润滑油强生润肤油有什么区别 我刚开的淘宝店 现在怎么更改不了店铺名? 杜蕾斯润滑液不同款式有什么区别 都是润滑剂,KEY润滑剂和杜蕾斯润滑液有什么不同?选哪个比较好? 杜蕾斯润滑液区别有哪些 请问青龙白虎朱雀玄武各自代表哪个方向,有没有什么其他的含义? 青龙白虎朱雀玄武分别在那个方向,财位在那个方位 请问百花需要戴玛尼神兽项链吗? dnf以前玛尼神兽项链那么贵 为什么现在那么便宜,我前几个星期看了下才30万。 地下城,玛尼神兽项链能镶嵌徽章吗?解封了能吗?如何在哪镶嵌。 玛尔神兽项链能换+13的残杀和一套怒灵吗? 杜蕾斯润滑剂红瓶和蓝瓶有什么区别 dnf河北2区玛尼神兽项链多少人民币 作为元素,黑珍珠和尼玛神兽项链,哪个更好点点??? DNF中的40粉链玛尼神兽项链在哪个图出的? DNF浙江4区玛尼神兽项链能卖多少RMB 地下城那里暴尼玛神兽项链?我是说刷深渊 40粉玛尼神兽项链.最好的属性是什么! 请问DNF60版本的时候据说有三个神器,一个是墨竹,一个是玛尼神兽项链,还有一个是什么??? 菏泽有没有教成人拉丁舞的地方? 无锡哪里有学成人拉丁舞的 安装有线电视跟使用网络电视哪个更经济实惠? 电信,移动,联通,广电哪家的电视+宽带比较好 笔记本电脑用网线连接路由器还要用户名和秘密吗?不要的话怎么连。 水素杯价格多少钱? CA302水素水杯价格是多少 水素水杯哪个牌子的性价高? 水素水杯哪个牌子好 想要买H2ELIXIR水素杯,不知道这个性价比高吗? 对水素杯有了解的可以来说下吗?H2ELIXIR水素杯和氢力泉氢水杯哪个更靠谱? 求实话!HE水素杯到底好不好用啊? 哪个牌子的水素水杯价格便宜? 水素水杯真的有效果吗? 航天富谷富氢水素杯子多少钱 摘要一般多少字呀? 论文摘要多少字合适? 摘要一般写多少字合适? 论文的摘要要写多少字? 论文摘要要多少字