Edit /etc/samba/smb.conf, set up "security=user" and "passdb backend = tdbsam" (both default), and add a [html] section as shown below.
Code:
[global]
workgroup = MSHOME
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
load printers = yes
cups options = raw
mangled names = no
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
[html]
comment = HTML
path = /var/www/html
public = yes
writable = yes
printable = no
create mask = 0775
read only = no
Add user/password via "smbpasswd"
Code:
# smbpasswd -a andreasoc <=== andreasoc must be a Linux userid
New SMB password: xxxxxx <=== may be different from Linux password
Retype new SMB password: xxxxxx
Added user andreasoc.
If samba client to be able to update, setup permission for /var/www/html
Code:
# chown -R andreasoc /var/www/html
or
# chmod -R 777 /var/www/html
Edit /etc/sysconfig/network to define hostname (eg soc used below) or via "# system-config-network"
Code:
HOSTNAME=soc.domain.com
Restart network if using network service (NetworkManager should pickup change automatically.)
Enable smb and nmb service
Code:
# /sbin/chkconfig smb on
# /sbin/chkconfig nmb on
Start smb and nmb service
Code:
# /sbin/service smb start
# /sbin/service nmb start
Accept samba ports in firewall.
Code:
# system-config-firewall
Click "Trusted Services" and "check" Samba 137/udp, 138/udp, 139/tcp, 445/tcp
Apply and Reload
Check that firewall is opened.
Code:
# nmap -p 445 localhost
To access share from Windows, type "\\soc\html" in windows file explorer, and enter userid/passwd setup via smbpasswd. To mount share, use "Tools->Map Network Drive..." select "H" for drive and enter "\\soc\html" in "Folder".