Centos6.5 安装 samba

来源:互联网 发布:有名的网络作词人 编辑:程序博客网 时间:2024/05/18 03:11

每次重装系统,都需要装 samba,这里记录下。

一般新装的系统都会自带samba相关包,如下:

rpm -qa | grep -i samba

samba-common-3.6.9-164.el6.x86_64 //配置文件及语法校验
samba-winbind-clients-3.6.9-164.el6.x86_64 //windows 域client
samba-winbind-3.6.9-164.el6.x86_64 //windows 域

但是缺少 samba 的可执行包。

直接 yum install samba, 会更新并安装相关的包, 如下:

Running Transaction
Updating : samba-common-3.6.23-20.el6.x86_64 1/9
Updating : samba-winbind-clients-3.6.23-20.el6.x86_64 2/9
Updating : samba-winbind-3.6.23-20.el6.x86_64 3/9
Installing : samba-3.6.23-20.el6.x86_64 4/9
Updating : libsmbclient-3.6.23-20.el6.x86_64 5/9
Cleanup : libsmbclient-3.6.9-164.el6.x86_64 6/9
Cleanup : samba-common-3.6.9-164.el6.x86_64 7/9
Cleanup : samba-winbind-clients-3.6.9-164.el6.x86_64 8/9
Cleanup : samba-winbind-3.6.9-164.el6.x86_64 9/9
Verifying : samba-winbind-3.6.23-20.el6.x86_64 1/9
Verifying : samba-common-3.6.23-20.el6.x86_64 2/9
Verifying : samba-winbind-clients-3.6.23-20.el6.x86_64 3/9
Verifying : samba-3.6.23-20.el6.x86_64 4/9
Verifying : libsmbclient-3.6.23-20.el6.x86_64 5/9
Verifying : samba-winbind-clients-3.6.9-164.el6.x86_64 6/9
Verifying : libsmbclient-3.6.9-164.el6.x86_64 7/9
Verifying : samba-winbind-3.6.9-164.el6.x86_64 8/9
Verifying : samba-common-3.6.9-164.el6.x86_64

安装完成配置 一个帐号:

smbpasswd root -a

添加一个共享目录

cp /etc/samba/smb.conf /etc/samba/smb.conf.bakvi /etc/samba/smb.conf

添加:

[share]
comment = Public Stuff
path = /home/share
public = yes
writable = yes
browseable = yes

关闭 selinux

setenforce 0

启动 smb 服务器

service smb startservice iptables stop //虚拟机调试touch test.txt //测试

windows上访问:
\{ip}\share

看到 test.txt

0 0
原创粉丝点击