Friday, December 12, 2008

Configuring SAMBA and SWAT in Solaris

#### Samba Server Configuration ####

root@Srv# cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf

Features:
1. File & Print sharing
2. Implemented as 2 daemons (smbd & nmbd)
smbd - file & print sharing connections based on SMB/CIFS protocols
SMB - TCP 139
CIFS - TCP 445
nmbd - handles NETBIOS names using primarily UDP connectivity
Browse list
Name of Servers
UDP 137 & 138
3. Legacy service - does not currently benifit from SMF
4. Service is located in: /etc/init.d & referenced via run-levels
5. Configuration changes to /etc/sfw/smb.conf are read automatically


root@Srv# vi /etc/swf/smb.conf
+------------------------------

workgroup = WORKGROUP

server string = SunSambaServer

security = user
## user --> Relies upon local Unix accounts & samba database to grant or deny access to shared resources (/etc/passwd, /etc/sfw/smbpasswd,/etc/sfw/smbusers)
## server --> Authentication to windows server
## domain
## ads

log file = /usr/local/samba/var/log.%m

local master = yes

os level = 33

#### Home Shares
[homes]
comment = Home Directories
browsable = no
writable = yes

##### Printer Shares
[printers]
comment = All Printers
path = /var/spool/samba
browsable = no
public = yes
writable = no
printable = yes


#### Public and Private Shares
[public]
comment = Public Stuff
path = /export/samba
public = yes
writable = yes
printable = no
write list = @staff

[emp1share]
comment = Emp1's Stuff
path = /private/Emp1
valid users = emp1
public = no
writable = yes
printable = no

--------------------------------------------+

root@Srv#/etc/init.d/samba start

root@Srv#netstat -anP tcp | less (check for 445 & 139)

root@Srv#netstat -anP udp | less (check for 137 & 138)

root@Srv# vi /etc/services
+----------------------------
cifs 445/tcp #CIFS for samba support

------------------------------+

root@Srv#netstat -aP tcp | less



#### User Authentication Mode
root@Srv#smbtree
Note: NETBIOS names are restricted to 16 characters, however, 15 characters are configurable
sunsrv01.mysolaris.com = FQDN

root@Srv#smbtree -U administrator

root@Srv#rdesktop -u administrator -g 700x550 -a

root@Srv#cd /etc/sfw/private

root@Srv#ls -ltr

root@Srv#smbpasswd -a emp1
root@Srv#smbpasswd -e emp1


##### Samba Web Admin Tool -SWAT ############
Steps to enable Swat:
1. create an /etc/services entry for SWAT - TCP:901
2. create an /etc/inetd.conf entry foe SWAT
swat stream tcp nowait root /usr/sfw/sbin/swat swat
3. Convert the inetd entry for SWAT to SMF using 'inetconv'


root@Srv# vi /etc/services
+---------------------------------
swat 901/tcp #Samba SWAT

----------------------------------+

root@Srv# vi /etc/inetd.conf
+------------------------------------
swat stream tcp nowait root /usr/sfw/sbin/swat swat

-------------------------------------+

root@Srv#inetconv

root@Srv#svcs -a | grep swat

root@Srv#svcs -l | grep swat

in explorer type http://localhost:901/

No comments: