安装:
yum -y install samba samba-client
添加Linux系统账户(useradd)
useradd work
将Linux已存在系统帐户添加到Samba应用中
pdbedit -a -u work
查看samba用户:
pdbedit -L
启动
systemctl start smb.service
源码安装:
安装依赖
yum install gcc gcc++ gnutls-devel python python-devel python-lib* libacl-devel openldap-devel -y
下载源码:
1、 tar -zxvf samba-4.6.4.tar.gz
2、 cd samba-4.6.4
3、 ./configure --prefix=/usr/local/samba/
4、 make
5、 make install
配置前期工作
1、 cp/tmp/samba-4.6.4/packaging/LSB/smb.conf /usr/local/samba/etc/
2、 cd !$
3、 cp smb.conf smb.conf.bak # 将smb.conf备份
4、 grep -Ev "#|^$|;" smb.conf.bak>smb.conf
配置smb.conf
[global]
workgroup = MYGROUP
server string = Samba Server
printcap name = /etc/printcap
load printers = yes
log file = /var/log/samba/log.%m
max log size = 50
security = user
#map to guest = Bad User #无密码登录
dns proxy = no
[homes]
comment = Home Directories
browseable =no #是否可见
writable = yes #是否可写入
添加系统用户到samba应用中,此密码是Samba密码,与Linux系统密码无关。
samba/bin/pdbedit -a -u user01
pdbedit -L查看samba用户
启动服务:
/usr/lcoal/samba/sbin/smbd