哈哈,今天确实是小有成就的,因为弄了好久的 samba 服务器终于配置好了。之前用 redhat 9 设置samba服务时,就直接用鼠标点几点就OK了,后来用fedora ,找不到它的图形化界面,就只能在文本模式下设置了,然后遇到好多问题,在网上不断的搜帖子,看别人的经验,也问了不少问题,今天终于在大家伙的帮助下把它搞定了,好开心。为了感谢大家的无私奉献,特地把我的收获写出来跟大家共同分享,希望诸位看了能有收获。
我装的这个 fedora 14 因为是在网上下的,所以似乎不是很全,像redhat 9 因为是用光盘装的,里面的所有软件包我给全选上了,所以也就什么都不用安了,而且还有图形化界面,操作起来超级方便。在 fedora 里面没有找到图形化界面,所以好麻烦。
开始还不知道没有安装samba ,然后试了几试发现不行,不知道从何下手,就在群里问大虾,大虾们还是很给力的,帮我支各种招,在此也感谢各位大虾的帮助。
然后大虾们叫我检查一下是否安装samba
[root@localhost ~]# rpm -qa | grep samba
samba-winbind-clients-3.5.5-68.fc14.1.i686 (开始只有这一行,然后大侠说我没有安装,于是我就开始安装了)
samba-common-3.5.8-76.fc14.i686
samba-3.5.8-76.fc14.i686 (这是安装之后的,这个才表示是samba 服务器安装成功)
这个安装我也是找了不少资料的,之前在网上搜到一种方法用 yum 安装,这个确实是很方便,然后我就直接用 yum -y install samba ,结果装了几次都是撞到一半系统卡死了,只能关电源来重启,我很纳闷,很伤心,就发贴求解答,然后有高手支招要我先 用 yum search samba 搜索一下 yum 源里有哪些,然后再用
yum -y install samba ,不过肯能当时的yun 源没有更新,只有很少,我当时也没有仔细看到底有些什么,只是先 yum search samba 再 yum -y install samba
在这里我先建议大家把yum 源更新一遍,因为用保持yum 源的更新就能安装比较好的软件了,呵呵 。当然,如果有高手直接用 源码包来安装的话,就对我这种还只能用yum 来安装软件的方法不屑一顾了呵。至于yum 的使用方法,我找到了一个比较全面的接受 yum 的使用的帖子,然后复制到了我们论坛来了这就是那个帖子的链接http://www.linuxdiyf.com/bbs/thread-205373-1-1.html
更新了 yum 之后,然后再 yum search samba 在列出的全部中选择你要安装的,用 yum -y install samba
================================ Matched: samba ================================
samba-client.i686 : Samba client programs
samba-common.i686 : Files used by both Samba servers and clients
samba-doc.i686 : Documentation for the Samba suite
samba-swat.i686 : The Samba SMB server Web configuration program
samba-winbind.i686 : Samba winbind
samba-winbind-clients.i686 : Samba winbind clients
samba-winbind-krb5-locator.i686 : Samba winbind krb5 locator
samba4.i686 : The Samba4 CIFS and AD client and server suite
samba4-devel.i686 : Developer tools for Samba libraries
samba4-libs.i686 : Samba libraries
system-config-samba.noarch : Samba server configuration tool
system-config-samba-docs.noarch : Documentation for configuring a Samba server
ctdb.i686 : A Clustered Database based on Samba's Trivial Database (TDB)
ncid-samba.noarch : NCID samba module sends caller ID information to windows
: machines
samba.i686 : Server and Client software to interoperate with Windows machines
samba-domainjoin-gui.i686 : Domainjoin GUI
samba-winbind-devel.i686 : Developer tools for the winbind library
samba4-pidl.i686 : Perl IDL compiler
sblim-cmpi-samba.i686 : SBLIM WBEM-SMT Samba
sblim-cmpi-samba-devel.i686 : SBLIM WBEM-SMT Samba - Header Development Files
sblim-cmpi-samba-test.i686 : SBLIM WBEM-SMT Samba - Testcase Files
ctdb-devel.i686 : CTDB clustered database development package
libsmbclient.i686 : The SMB client library
libsmbclient-devel.i686 : Developer tools for the SMB client library
mod_auth_ntlm_winbind.i686 : NTLM authentication for the Apache web server using
: winbind daemon
php-pear-Auth-samba.noarch : Samba support for php-pear-Auth
php-pear-File-SMBPasswd.noarch : Class for managing SAMBA style password files
smbldap-tools.noarch : User and group administration tools for Samba/OpenLDAP
thunar-shares-plugin.i686 : Thunar file manager extension to share files using
: Samba
amanda.i686 : A network-capable tape backup solution
ccache.i686 : C/C++ compiler cache
cifs-utils.i686 : Utilities for mounting and managing CIFS mounts
dbench.i686 : Filesystem load benchmarking tool
distcc.i686 : Distributed C/C++ compilation
distcc-server.i686 : Server for distributed C/C++ compilation
fuse-smb.i686 : FUSE-Filesystem to fast and easy access remote resources via SMB
konq-plugins.i686 : Additional plugins that interact with konqueror
ldb-tools.i686 : Tools to manage LDB files
libldb.i686 : A schema-less, ldap like, API and database
libldb-devel.i686 : Developer tools for the LDB library
libntlm.i686 : NTLM authentication library
libtalloc.i686 : The talloc library
libtalloc-devel.i686 : Developer tools for the Talloc library
libtdb.i686 : The tdb library
libtdb-devel.i686 : Header files need to link the Tdb library
libtevent.i686 : The tevent library
libtevent-devel.i686 : Developer tools for the Tevent library
partimage-server.i686 : Server daemon for remote imaging, much like Ghost
perl-Crypt-SmbHash.noarch : Pure-perl Lanman and NT MD4 hash functions
ppp.i686 : The Point-to-Point Protocol daemon
ppp-devel.i686 : Headers for ppp plugin development
python-dulwich.i686 : A python implementation of the Git file formats and
: protocols
python-smbpasswd.i686 : Python SMB Password Hash Generator Module
python3-smbpasswd.i686 : Python SMB Password Hst Generator Module for Python 3
rsync.i686 : A program for synchronizing files over a network
rzip.i686 : A large-file compression program
sblim-cmpi-dns.i686 : SBLIM WBEM-SMT Dns
sblim-tools-libra.i686 : SBLIM Common Resource Access Library for WBEM-SMT tasks
sblim-tools-libra-devel.i686 : SBLIM Common Resource Access Library for WBEM-SMT
: tasks Header Devel Files
smb4k.i686 : The SMB/CIFS Share Browser for KDE
snort.i686 : Intrusion detection system
tdb-tools.i686 : Developer tools for the Tdb library
以上是我 yum 源里所有和samba 有关的,我选择了安装samba.i686 。这是安装。装好了之后大家可以用上面的讲的检查一下是否安装成功。
然后就是设置用户了,在网上看到一种方法是用 samba -a username 但是我用这个提示说 command not found 然后我就很纳闷了,怎么就找不到呢?就在群里问,关键时刻大虾给力,叫我用 smbpasswd -a username 对了,这个是要创建密码的,可以跟你登录系统密码不一样。然后就出现一串开头都是 account_policy_get 的 不过最后一句我懂,是Added user liveuser(liveuser 是我的用户名),我知道,用户名创建成功。
这是用户名创建成功。
接下来就是配置samba 服务器了。在这里我看了几篇别人写的帖子,但是对于他们那简短的几行我很纳闷,为什么我的就这么多呢?然后有点无从下手,还好我装了两个Linux系统,其中一个的samba服务还是能用的,嘿嘿,我就将两个系统的smb.conf 做个对比,但是这个因为系统不一样,还是有点区别,于是我就在网上搜看有没有 fedora 14 的 samba 配置,结果还真找到了(互联网果然厉害!),http://wb127.blog.51cto.com/blog/2232662/509241就是这篇帖子,不过当我再按照这个对的时候,才意识到其实确实是只需要对几行就可以了,因为那些#开头和;开头的都是注释的,这个不管怎样都无所谓,所以真正要看的就几行,然后我发现我的跟他是一模一样的,真是一模一样。然后我就关闭防火墙,之前看到别的帖子也提到过要更改防火墙的设置,但是没有这个来的方便,所有我推荐大家按照这个方法来关闭防火墙 即sudo /etc/init.d/iptables stop
然后就是关闭SELinux ,其实到这里应该就可以用samba 了,我试了(其实是无意中试的,因为我在设置关闭SELinux时,掉了一个d,结果并没有关闭,SELinux),那为什么要关闭呢,大家都知道这个 SELinux 是一个加强LINUX安全的子系统,不关闭SELinux 你可以看到你共享的文件夹,但是你打不开它,会弹出窗口说你没有权限,就算是你chmod 777 也不行,所以要关闭 SELinux
[root@localhost ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
#SELINUX=enforcing (原来这行是没有注释的,这是我改了的)
SELINUX=disabled (这行是我加的,是关闭SELINUX的,我开始就是这里的d给掉了)
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
然后就重启SELINUX就可以了,即选择重启系统或者注销,至于选择哪个,都可以,我是选择注销的。
然后,samba 服务就可以用了。以上就是我的一些经验,希望能对大家有所帮助
gky2009514 于 2012-12-07 13:08:04发表:
新手完成任务,求下书籍~
livip2006 于 2012-04-13 09:03:18发表:
pstree|grep mbd
|-nmbd
|-smbd--smbd
#samba启动
linux_fanfan 于 2011-10-19 23:58:49发表:
佩服,佩服,我要向你学习
秦合六一 于 2011-09-05 22:42:15发表:
学习一下下
xiaoxiongde110 于 2011-09-05 20:12:17发表:
学习了!
wangmingsd 于 2011-08-24 18:37:10发表:
非常感谢,收藏。
wangmingsd 于 2011-08-24 18:37:06发表:
非常感谢,收藏。
wangmingsd 于 2011-08-24 18:37:03发表:
非常感谢,收藏。
tan0620 于 2011-08-11 15:32:22发表:
感谢分享
tuerqi8 于 2011-08-10 18:56:40发表:
广扩知识
nishui333 于 2011-08-09 17:16:48发表:
刚开始 还在探索中 广收知识
edwardfan 于 2011-08-08 10:06:42发表:
感谢分享,学习学习
Growth兆 于 2011-08-07 09:37:46发表:
感谢专攻Linux/ARM的分享,本贴加入到论坛顶置的Linux应用索引贴中
alick 于 2011-08-06 23:53:37发表:
有一个简单的图形界面配置samba 的工具,叫 system-config-samba,
可以用yum安装
SELinux 没有必要关。至多有一些警告,按照提示做就行了。可能需要
restorecon 什么的。
防火墙也不建议关。要使其他电脑可以访问本机samba共享,只需打开对应
的几个端口。直接用 iptables 命令,或者图形界面的 system-config-firewall
来配置。
Segim 于 2011-08-05 21:18:38发表:
很强啊,受教了