标签:
yum install python-devel gnutls-devel libacl-devel openldap-devel
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
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
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
右击“计算机” - “映射网络驱动器”
标签:
原文地址:http://www.cnblogs.com/coolking/p/5569154.html