码迷,mamicode.com
首页 > 其他好文 > 详细

samba编译安装(简)

时间:2016-06-08 10:44:24      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

基础环境安装

yum install python-devel gnutls-devel libacl-devel openldap-devel

samba编译安装

tar zxf samba-latest.tar.gz
cd samba-4.4.3
./configure
make && make install

# 安装完成后,需要拷贝一个配置文件
cp /tmp/samba-4.4.3/examples/smb.conf.default /usr/local/samba/etc/
cd /usr/local/samba/etc/
grep -v "^#" smb.conf.default | grep -v "^;" | sed /^$/d > smb.conf

samba配置文件配置

vim /usr/local/samba/etc/smb.conf
[global]
   workgroup = WORKGROUP
   server string = King of Samba
   server role = standalone server
   log file = /usr/local/samba/var/log.%m
   hosts allow = 192.168.0.0/255.255.255.0  # 指定samba允许主机
   max log size = 50
   dns proxy = no
   max connections = 100  # 设置samba最大连接数,主要防止太大I/O影响到系统
   security = user  # 仅允许用户名密码登录samba
   encrypt passwords = yes  # 将密码加密
[war_bak]
   comment = samba admin
   browseable = yes
   path = /data/smb/war_bak # 指定该共享登录目录
   writable = yes  # 是否允许写入
   #admin users = eason
   valid users = eason   # 授权用户
   public=no   # 匿名访问
   create mask=0770  # 创建文件权限
   directory mask=0770  # 创建文件夹权限

配置共享目录

mkdir -p /data/smb/war_bak

配置启动

# 启动
/usr/local/samba/sbin/nmbd -D
/usr/local/samba/sbin/smbd -D
# 停止
Kill -9 $PID

# 添加启动项
vim /etc/rc.local
...
/usr/local/samba/sbin/nmbd -D
/usr/local/samba/sbin/smbd -D

配置samba用户

useradd -s /sbin/nologin eason   # 创建一个系统用户
/usr/local/samba/bin/smbpasswd -a eason  # smb中添加eason用户
/usr/local/samba/bin/smbpasswd -e eason  # 启用该smb用户

测试:

/usr/local/samba/bin/testparm

最后,我们可以将samba映射到windows磁盘中

右击“计算机” - “映射网络驱动器”

samba编译安装(简)

标签:

原文地址:http://www.cnblogs.com/coolking/p/5569154.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!