#vi /usr/local/etc/smb4.conf[root]comment=root's stuff path = /root public = no browseable = yes writable = yes printable = no create mask = 0755
创建 samba root 用户:
# smbpasswd -a root
进入 /usr/local/etc
# cd /usr/local/etc
再执行
# service samba_server start //启动命令
或
# service samba_server restart //重启命令
查看 samba 状态:
# service samba_server status
在 windows 下利用 192.168.X.X 访问共享文件夹(以实际 IP 为准,Windows 需要先开启 SMB 1.0 支持)
192.168.X.X
将 Samba 设置为域成员
环境:freebsd 12
配置静态 IP 地址
使用如下命令配置:
bsdconfig
配置主机名
# ee /etc/rc.confhostname="fb"
配置 DNS
# ee /etc/resolv.conf# Generated by resolvconfsearchSVROS.COM//设置域控制器域名# nameserver 192.168.253.2nameserver192.168.253.130//设置域控制器IP地址nameserver223.5.5.5nameserver127.0.0.1optionsedns0
netadsjoin--no-dns-updates-Uadministratornetadstestjoin# Should report "Join is OK"# On your DC, open the DNS MMC and add an "A" entry for your BSD server so clients can find it
kinitadministrator# Enter domain admin password, it should return to the prompt with no errorsklist# Credentials cache: FILE:/tmp/krb5cc_0# Principal: administrator@SVROS.COM## Issued Expires Principal# Dec 6 10:15:39 2021 Feb 4 20:15:39 2021 krbtgt
测试 Winbind
wbinfo-u# Should return domain userswbinfo-g# Should return domain groupsgetentpasswd# Should return domain users at the end of the list with 10000+ UIDsgetentgroup# Should return domain groups at the end of the list with 10000+ GIDs