开发机环境:freebsd
1、添加samba用户
smbpasswd 路径:/usr/local/etc/smbpasswd
sudo smbpasswd -a eoiioe //添加的用户名必须是系统内已有的用户名,此时会提示输入密码
sudo smbpasswd -e eoiioe //激活用户
2、修改/usr/local/etc/smb.conf配置用户信息
添加用户响应信息
[eoiioe]
comment = eoiioe's Services //此处写提示语
path = /home/eoiioe
public = no
valid users = eoiioe
writable = yes
create mask =0755
guest ok = no
3、重启samba服务
sudo samba.sh stop
系统提示
“Waiting for PIDS: 2038, 2038,2038, ....”
wait了很长时间,于是
sudo kill -9 2038
显示“smbd already running? (pid=2059).”
此时只是kill掉了nmbd, smbd还在running,此时还应该kill -9 2059
最后 sudo samba.sh start
samba配置完成
samba.sh 文件 内容

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

centos 下相对简单
1.启动 Samba 服务。
# chkconfig smb on ← 设置 Samba 自启动
# service smb start ← 启动Samba服务
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
# smbpasswd -a root ← 将系统用户 root 加入到 Samba 用户数据库
New SMB password: ← 输入该用户用于登录 Samba 的密码
Retype new SMB password: ← 再次确认输入该密码
Added user centospub.
# smbpasswd -e root ← 激活该用户
2.配置Samba
通过编辑 /etc/samba/smb.conf 让将要被共享的目录拥有充分的读写权限属性。
3.修改完smb.conf文件后一定要重启sam服务
# servcie smb restart ---重启smb服务