Добавлены samba36 (помню, что кто-то спрашивал) and msmtp.
Тестируем, особенно самбу.
Небольшая инструкция для samba36
Устанавливаем
Code:
opkg install samba36-server
В /opt/etc/samba видим smb.conf.template вот такого содержания:
Code:
[global]
netbios name = |NAME|
display charset = |CHARSET|
interfaces = |INTERFACES|
server string = |DESCRIPTION|
unix charset = |CHARSET|
workgroup = |WORKGROUP|
browseable = yes
deadtime = 30
domain master = yes
encrypt passwords = true
enable core files = no
guest account = nobody
guest ok = yes
invalid users = root
local master = yes
load printers = no
map to guest = Bad User
max protocol = SMB2
min receivefile size = 16384
null passwords = yes
obey pam restrictions = yes
os level = 20
passdb backend = smbpasswd
preferred master = yes
printable = no
security = user
smb encrypt = disabled
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY IPTOS_LOWDELAY
syslog = 2
use sendfile = yes
writeable = yes
Создаем там же из него smb.conf
Code:
$ cat /opt/etc/samba/smb.conf.template > /opt/etc/samba/smb.conf
И этот конфиг настраиваем под себя.
Например изменяем
smb passwd file = /etc/samba/smbpasswd на smb passwd file = /opt/etc/samba/smbpasswd
По совету MercuryV можно добавить также
Code:
create mask = 0644
directory mask = 0766
чтобы все файлы, копируемые в шару из Windows, НЕ получали атрибут исполняемых по умолчанию.
Если нужно организовать парольный доступ, то нужно его добавить в /opt/etc/samba/smbpasswd так
Code:
$ smbpasswd -a primer
На запрос установки пароля - вводим пароль.
Правда перед этим нужно убедиться, что такой пользователь есть в системе
Если его нет, то соответственно добавить.
Вот мой последний рабочий конфиг
Code:
[global]
netbios name = RT-N16
workgroup = MYHOME
server string = ASUS Router
force user = admin
interfaces = 192.168.1.1/24
bind interfaces only = yes
browseable = yes
deadtime = 30
encrypt passwords = true
enable core files = no
guest account = nobody
invalid users = root
load printers = no
local master = yes
map to guest = Bad User
min receivefile size = 0
null passwords = yes
obey pam restrictions = no
os level = 20
passdb backend = smbpasswd
#passdb backend = tdbsam
preferred master = auto
aio read size = 8192
aio write size = 8192
max protocol = SMB2
write cache size = 16384
read raw = yes
write raw = yes
printable = no
reset on zero vc = yes
remote announce = 192.168.1.255
security = user
smb encrypt = disabled
smb passwd file = /opt/etc/samba/smbpasswd
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65535 SO_SNDBUF=65535 SO_KEEPALIVE
syslog = 3
writeable = yes
unix charset = UTF-8
use sendfile = yes
[data]
path = /tmp/mnt/HDD
browseable = yes
guest ok = no
writeable = yes
Теперь запуск
У меня запуск организован через cat /opt/etc/init.d/rc.unslung
Т.е. в /opt/etc/init.d находится файл S08samba такого содержания
Code:
#!/bin/sh
start() {
echo "starting nmbd:"
/opt/sbin/nmbd -D
echo "Starting smbd:"
/opt/sbin/smbd -D
}
stop() {
if [ -n "`pidof smbd`" ] ; then
echo "Stopping smbd:"
killall smbd
fi
if [ -n "`pidof nmbd`" ] ; then
echo "Stopping nmbd:"
killall nmbd
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 4
start
;;
*)
echo "Usage: $0 (start|stop|restart)"
exit 1
;;
esac
exit 0
Этот скрипт должен быть исполняемым!
Пожалуй все