BigAdmin
BigAdmin System Administration Portal
Community-Submitted Tech Tip
Print-friendly VersionPrint-friendly Version
This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article. Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
 
 

Implementing Samba on the Solaris 8 OS

Yazid Mohamed, September 2006

The Samba web site describes Samba as an open source/free software suite that provides file and print services. Samba can be installed to share files or printers between UNIX environments (such as the Solaris OS) and the Windows platform. This Tech Tip shows you how to set Samba up for your Solaris 8 Operating System. (Editor's note: Samba is built into the Solaris 10 OS; see the "Samba Enhancements" section in Solaris 10 What's New.)


1. Install Samba

The Samba package can be downloaded from http://samba.org. For this example, use Samba version 3.0.22. Download the file into any directory such as /opt/download. Extract the gunzip file and install Samba.

# cd /opt/download
# gunzip samba-3.0.22.tar.gz
# tar xvf samba-3.0.22.tar
# cd samba-3.0.22
# cd source
# ./configure
# make
# make install

The Samba files are located in /usr/local/samba.


2. Configure File Sharing

First, you need to modify the man path for Samba. Edit the file /.profile by adding this line:

MANPATH=$MANPATH:/usr/man/:/usr/local/man:/usr/local/samba/man

Create a shared directory:

# mkdir /sharedir
# chmod 777 /sharedir
# chown sys /sharedir
# chgrp sys /sharedir

Edit the file /usr/local/samba/lib/smb.conf. You can find an example of this file in /opt/download/samba-3.0.22/examples/smb.conf.default. Copy the example file and edit the configuration.

# cd /opt/download/samba-3.0.22/examples
# cp smb.conf.default /usr/local/samba/lib/smb.conf
# cd / usr/local/samba/lib/
# vi smb.conf

This is the example of smb.conf:

[global]
workgroup = MYGROUP
server string = Samba Server
security = share
hosts allow = localhost, 20.195.109.114
load printers = no
log file = /usr/local/samba/var/log.%m
max log size = 50

[homes]
comment = Home Directories
browseable = no
writable = yes

[printers]
comment = All Printers
path = /usr/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes

[myshare]
comment = Samba share files
path = /sharedir
public = yes
writable = yes
printable = no
read only = no

After configuring the smb.conf, you can test it by running /usr/local/samba/bin/testparm. The result should display as the following:

Processing section "[homes]"
Processing section "[printers]"
Processing section "[myshare]"
Loaded services file OK.
WARNING: passdb expand explicit = yes is deprecated
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

3. Start Samba Services

Check your /etc/services file. Make sure that all the following lines are in the file:

sunrpc 111/tcp rpcbind
netbios-ns 137/udp
netbios-ssn 139/tcp
ldaps 636/udp
swat 901/tcp

Then edit the file /etc/inetd.conf by adding the following three lines:

netbios-ssn stream tcp nowait root /usr/local/samba/sbin/smbd smbd
netbios-ns dgram udp wait root /usr/local/samba/sbin/nmbd nmbd
swat stream tcp nowait.400 root /usr/local/samba/sbin/swat swat

Restart the inetd daemon:

# pkill -HUP inetd

4. Test File Sharing

Use Windows Network Neighborhood to test Samba file sharing. You should find the Samba Server in the MYGROUP workgroup. Now you can add, copy, edit, or delete files inside the sharedir directory.

You also can configure Samba by using the Samba Web Administration Tool (SWAT). Start your Internet browser and type either of the following URLs:

http://localhost:901
http://your-samba-server-ip-address:901

For More Information

For further information, see the Samba man pages. The following command locates these man pages:

man -M /usr/sfw/man samba

See also Using Samba, Second Edition by Jay Ts, Robert Eckstein, and David Collier-Brown, published by O'Reilly.

 


The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource.

Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.
  
 
 
 
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News & Events Employment Site Map Privacy Terms of Use Trademarks Copyright Sun Microsystems, Inc.