导航:首页 > IDC知识 > redhatsamba服务器

redhatsamba服务器

发布时间:2020-11-14 05:05:24

1、如何在RedHat中安装samba

mount 安装光盘,配置好yum源到安装光盘所在目录,例如/mnt: vi /etc/yum.repos.d/local.repo 配置如下: [Server] name=Server baseurl=file:///mnt/ gpgcheck=0 enabled=1 执行yum安装: yum install samba*

2、如何在RedHat中安装samba

(1)运用rpm -qa |grep samba查看本计算机中是否以及安装了samba的哪些包。[root@server1 Server]# rpm -qa |grep samba
samba-common-3.0.25b-0.el5.4 samba-3.0.25b-0.el5.4samba-client-3.0.25b-0.el5.4
(2)运用rpm安装相关的samba的所有包,如果安装过就不要再安装了。
[root@server1 Server]# rpm -ivh samba-common-3.0.25b-0.el5.4
[root@server1 Server]# rpm -ivh samba-3.0.25b-0.el5.4[root@server1 Server]# rpm -ivh samba-client-3.0.25b-0.el5.4
(3)用vim打开samba的配置,并对其内相关内容进行编辑和修改[root@server1 Server]# vim /etc/samba/smb.conf

3、在linux redhat 5中如何设置samba服务器,如何与windows实现访问?

一.搭建基本共享文件,匿名访问:
1.备份smb.conf文件,出现问题好恢复:
[root@epro samba]# cp -p smb.conf smb.conf.bak
2.编辑smb.conf文件
[root@epro samba]# gedit smb.conf
在---------Standalone Server Options----------这条语句下面
修改:
security = share
passdb backend = tdbsam
默认是没有/etc/samba/smbpasswd文件,在Standalone Server Options加上下面这句就有了:
smb passwd file = /etc/samba/smbpasswd

默认的security = user(需要系统账户访问) 改为security = share (可以使用匿名访问)
在----------Share Definitions---------- 这条语句下面
添加:
[share]
comment = share of test
public = yes
path = /mnt/abc
writable = yes
printable = no
解释:
[share] ——服务器共享文档名称
comment = share ——服务器说明
path = /mnt/abc ——共享文档的路径
publice = yes ——允许匿名访问
writable = yes ——允许写入(前提是目录本身有其他用户写入的权限)
printable = no —— 并非打印机
3.建立共享文件夹
[root@epro ~]# mkdir /mnt/abc //创建文件夹abc
[root@epro ~]# cd /mnt
[root@epro mnt]# chmod 1777 abc //修改abc文件夹的权限为777,设置冒险位为1
设置冒险位作用:目的是用户a在共享目录里面写入文件,那么用户b登陆看到之后只能读取却不能删除,起到了防止用户误删除其他用户的文件
4.重新启动samba服务
[root@epro abc]# service smb restart
[root@epro abc]#chkconfig --level 3 smb on //运行级别3自动加载
也可以用ntsysv,图形化设置自动运行
5.用windows去访问SAMBA共享文件:
\\192.168.0.14\share

以上为个人实验后写下的笔记,都是纯手工输入的。。。。

4、redhat enterprise 如何配置samba服务器

/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差不多 窗口化的配置比较直观也比较简单

5、在RHEL7中 samba服务器默认的身份验证方式是什么?

设置用户访问Samba Server的验证方式,一共有四种验证方式。默认是第一种。

share:用户访问Samba Server不需要提供用户名和口令, 安全性能较低。

2. user:Samba Server共享目录只能被授权的用户访问,由Samba Server负责检查账号和密码的正确性。账号和密码要在本Samba Server中建立。SAMBA文件共享服务

3.server:依靠其他Windows NT/2000或Samba Server来验证用户的账号和密码,是一种代理验证。此种安全模式下,系统管理员可以把所有的Windows用户和口令集中到一个NT系统上,使用Windows NT进行Samba认证, 远程服务器可以自动认证全部用户和口令,如果认证失败,Samba将使用用户级安全模式作为替代的方式。

4.domain:域安全级别,使用主域控制器(PDC)来完成认证。

6、redhat怎么访问linux系统smb

在Linux系统中访问Samba服务器中的共享目录需要使用smbclient命令,当然首先得在对应Linux系统主机中安装Samba服务的客户端软件--smbclient。使用smbclient -L命令(有关smbclient命令的详细选项可通过smbclient -help命令查看)可以查看指定Samba服务器上的所有共享目录。如要浏览本示例中Sambaserver上的共享目录,可以在终端提示符下输入以下命令:
smbclient -L Sambaserver

在出现提示输入密码时,直接按Enter键(因为此处是匿名访问),结果会显示指定Samba服务器上当前全部的共享目录,
使用共享目录的命令格式为:smbclient //IP地址或主机名/共享目录名 -U用户名。
因为此处是匿名访问,所以无须加上"-U"选项来指定访问的用户名。如在此要匿名访问Sambaserver上的doc目录,则可以在终端提示符下输入以下命令:

smbclient //Sambaserver/doc

在出现输入密码的password提示符时,直接按Enter键,即进入到远程使用服务器上指定资源的提示符smb:\>,与FTP客户端相似,这时可以使用如cd、cat、get等命令对共享目录和文件进行操作了。注意,这个命令不仅可以访问Samba服务器上的共享资源,还可以访问网络中Windows主机上的共享资源。

7、redhat 7.0怎么开启samba

安装samba包
yum install samba

查看Samba配置文件
cat/etc/samba/smb.conf

使用Samba服务口令验证方式可以让共享文件更加的安全,做到仅让信任的用户访问,而且验证过程也很简单,要想使用口令验证模式,我们需要先创建Samba服务独立的数据库。
第1步:检查当前是否为user验证模式。
[root@linuxprobe ~]# cat /etc/samba/smb.conf

第2步:创建共享文件夹:
[root@linuxprobe ~]# mkdir /database

第3步:描述共享文件夹信息。
在SMB服务主配置文件的最下面追加共享文件夹的配置参数:
[database]
comment = Do not arbitrarily modify the database file
path = /database
public = no
writable = yes
保存smb.conf文件后重启启动SMB服务:
[root@linuxprobe ~]# systemctl restart smb

添加到开机启动项:

具体详细步骤查看http://www.linuxprobe.com/chapter-12.html#1221

8、redhat7.0 在配置samba服务器出现问题 samba服务器启动不了

不好意思貌似你的samba软件没有安装成功或者说没有安装正确,建议重新安装,然后再试一下,不行再留言给我

9、如何在RedHat中安装samba

1、检查Samba服务包是否已复安装

#rpm -qa | grep samba
    samba-3.5.4-68.el6.x86_64
    samba-common-3.5.4-68.el6.x86_64
    samba-client-3.5.4-68.el6.x86_64
    samba4-libs-4.0.0-23.alpha11.el6.x86_64
    samba-winbind-clients-3.5.4-68.el6.x86_64



若是以上结制果,则说明samba已经安装,如果没有安装,运行下面命令安装 :

#yum install samba

YUM安装会自己安装服务的依赖包 ,快捷 简单 ,安装前建议关闭selinux

10、用RedHat下的Linux:SAMBA 安装架设SAMBA服务器,实现linux和windows资源共享,要

你要共享的文件夹为: /homes

首先创建这个文件夹

mkdir /homes/

chmod 777 /homes
备份并编辑smb.conf允许网络用户访问
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
搜寻这一行文字

; security = user

用下面这几行取代

security = user

username map = /etc/samba/smbusers

将下列几行新增到文件的最后面,假设允许访问的用户为:newsfan。而文件夹的共享名为 Share

[Share]

comment = Shared Folder with username and password

path = /homes

public = yes

writable = yes

valid users = newsfan

create mask = 0700

directory mask = 0700

force user = nobody

force group = nogroup

available = yes

browseable = yes

然后顺便把这里改一下,找到[global]把 workgroup = MSHOME 改成

workgroup = WORKGROUP

display charset = UTF-8

unix charset = UTF-8

dos charset = cp936

后面的三行是为了防止出现中文目录乱码的情况。其中根据你的local,UTF-8 有可能需要改成 cp936。自己看着办吧。
现在要添加newsfan这个网络访问帐户。如果系统中当前没有这个帐户,那么

sudo useradd newsfan

要注意,上面只是增加了newsfan这个用户,却没有给用户赋予本机登录密码。所以这个用户将只能从远程访问,不能从本机登录。而且samba的登录密码可以和本机登录密码不一样。

现在要新增网络使用者的帐号:

sudo smbpasswd -a newsfan

sudo gedit /etc/samba/smbusers

在新建立的文件内加入下面这一行并保存

newsfan = "network username"

如果将来需要更改newsfan的网络访问密码,也用这个命令更改

sudo smbpasswd -a newsfan

删除网络使用者的帐号的命令把上面的 -a 改成 -x

sudo testparm

sudo /etc/init.d/samba restart

如果还是不行查看Iptables(防火墙是否开启),如果开启可以先将服务停止。

最后退出重新登录或者重新启动一下机器。
配置文件 /etc/samba/

//设置samba密码文件

# cat /etc/passwd|mksmbpasswd.sh > /etc/samba/smbpasswd

//为安全起见,设置文件和目录的权限

# chown root.root /etc/samba/smbpasswd

# chmod 500 /etc/samba

# chmod 600 /etc/samba/smbpasswd

//为用户设置口令

#smbpasswd root

//检查配置文件的正确性

# testparm

//检查服务器所共享的资源

# smbclient –L localhost

//列出资源使用情况

# smbstatus [-b]

//配置文件

节:

l [Global] 定义全局参数和缺省值

l [Homes] 定义用户的Home目录共享

l [Printers] 定义打印机共享

l [Userdefined_ShareName] 用户自定义共享(可有多个)

变量:

l %S 当前服务名

l %P 当前服务的根路径

l %u 当前服务的用户名

l %g 给定%u的所在工作组名

l %H 给定%u的宿主目录

l %v Samba版本号

l %h 运行服务的主机名

l %m 客户机的NETBIOS名

l %L 服务器的NetBIOS名

l %L 当前的日期和时间

//使用符号链接组织本地共享资源

# vi /etc/samba/smb.conf

[Resource]

comment = Local Resource

path = /var/samba/resource

public = yes

writeable = yes

// -p parent(no error if existing, make parent directories as needed)

# mkdir –p /var/samba/resource

#cd /var/samba/resource

//-s, --symbolic

# ln –s /usr/share/doc doc

//为所有用户配置只读共享和读写共享

# vi /etc/samba/smb.conf

[tmp]

comment = Temporary file space

path = /tem

read only = no

public = yes

[cdrom]

comment = CDROM

path = /mnt/cdrom

read only = yes

public = yes

//为指定用户或组配置共享

# useradd samba

# passwd samba

# mkdir /var/samba/samba

//更改目录属主

# chown samba.samba /var/samba/samba

# vi smb.conf

[sambadir]

comment = Samba's service

path = /var/samba/samba

valid users = samba

public = no

writable = yes

//保存修改

//Linux环境下访问Samba共享

# cat /etc/samba/lmhosts

# smbclient –L IP –U 用户名

# smbmount //win/tools /mnt/smb/win

与redhatsamba服务器相关的知识