install พิมพ์
apt-get install -y samba samba-common python-glade2 system-config-samba
backup file config แล้วแก้ไข
non secure
cp -pf /etc/samba/smb.conf /etc/samba/smb.conf.bak
cat /dev/null > /etc/samba/smb.conf
nano /etc/samba/smb.conf
และเพิ่มบรรทัดต่อไปนี้
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[mariadb_data]
path = /var/lib/mysql
browsable =yes
writable = yes
guest ok = yes
read only = no
force user = nobody
กำหนด permission ให้ folder /var/lib/mysql
chmod -R 0775 /var/lib/mysql
chown -R nobody:nogroup /var/lib/mysql
service smbd restart
test on windows ที่ command
\\host
Secure
incommand
addgroup smbgrp
useradd kob -G smbgrp
smbpasswd -a kob
output
New SMB password:
Retype new SMB password:
Added user kob.
chmod -R 0770 /var/www/html
chown root:smbgrp /var/www/html
nano /etc/samba/smb.conf
typing: and save
[bchn_web1]
path = /var/www/html
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes
exit
systemctl restart smbd
test
ถ้าเข้าไม่ได้อาจจะติด firewall ให้เพิ่มคำสั่ง
sudo ufw allow Samba