Настройка samba


Начинаем с главного конфигурационного файла /opt/etc/smb.conf:

[global]
local master = yes
domain master = no
preferred master = yes
interfaces = br0
bind interfaces only = yes
workgroup = workgroup
server string = asus
guest account = nobody
security = user
browseable = yes
dns proxy = no
guest only = no
guest ok = yes
log level = 1
max log size = 100
encrypt passwords = yes
preserve case = yes
short preserve case = yes
client code page = 866
character set = 1251
wins support = yes
time server = yes
os level = 255
hosts allow = 192.168.1.

[share$]
path = /
comment = share
guest ok = no
writable = yes
force user = admin
browseable = no
valid users = admin

$ echo ln -s /opt/etc/smb.conf /etc/smb.conf >> /usr/local/sbin/post-boot
$ ln -s /opt/etc/smb.conf /etc/smb.conf

$ echo ln -s /opt/etc/smbpasswd /etc/smbpasswd >> /usr/local/sbin/post-boot
$ ln -s /opt/etc/smbpasswd /etc/smbpasswd

# автозагрузка
$ echo nmbd -D -s /opt/etc/smb.conf >> /usr/local/sbin/post-boot
$ echo smbd -D -s /opt/etc/smb.conf >> /usr/local/sbin/post-boot

Сохраняемся:

$ flashfs save && flashfs commit && flashfs enable && reboot

Добавлять в samba можно только тех пользователей, которые есть в passwd:

smbpasswd -a admin
adduser -h /opt/home -s /sbin/nologin -G users -H new_user
smbpasswd -a new_user