Samba on Solaris 10

I am a newb

Can some please tell me how i can configure samba on Solaris 10 ? Is samba already installed on Solaris 10?

Here is the result of what i found on the system

bash-3.00# svcs -a | grep samba

legacy_runSep_06lrc:/etc/rc3_d/S90samba

bash-3.00#

Your help is greatly appreciated

Thanks

Harry

[352 byte] By [HarrySukumar] at [2007-11-26 10:00:58]
# 1

Hi harry:

You can use swat for configure the smb.conf file, the shared resources and the services, you should add the swat in the port 901 in /etc/services and then you can access with http:\\yoourserver:901 in your browser.

I recommend you only use swat for the first configuration.

Regards.

Emilio

darma at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 2

Hi harry:

You can use swat for configure the smb.conf file, the shared resources and the services, you should add the swat in the port 901 in /etc/services and then you can access with http:\\yoourserver:901 in your browser.

I recommend you only use swat for the first configuration.

Regards.

Emilio

darma at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 3

Hi Darma,

Thanks for the reply can you please explain me how exactly i am suppose to be doing this as when i tried to edit /ete/service file it come up with a message saying it is a read only file and felt that it is not the right way to go about..

Darma if you happen to find some time can you explain me how to setup samba on solaris 10

Thanking you in Advance

Message was edited by:

HarrySukumar

HarrySukumar at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 4

Hi, here is a detailed description on how i have setup Samba, as as SMF service, it covers the SMF setup and the Swat configuration. I converted it from a word document, so the formatting is not verry nice, sorry.

Samba

We use the samba from sun (SFW) its configuration files are in /etc/sfw

Samba Setup

First we remove the old startup scripts:

# ls -l /etc/rc?.d/?samba

-rwxr--r--6 rootsys 324 Jan 14 2006 /etc/rc0.d/K03samba

-rwxr--r--6 rootsys 324 Jan 14 2006 /etc/rc1.d/K03samba

-rwxr--r--6 rootsys 324 Jan 14 2006 /etc/rc2.d/K03samba

-rwxr--r--6 rootsys 324 Jan 14 2006 /etc/rc3.d/S90samba

-rwxr--r--6 rootsys 324 Jan 14 2006 /etc/rcS.d/K03samba

# rm /etc/rc?.d/?samba

# mv /etc/init.d/samba /etc/init.d/nonsmf_samba

Then we need a configuration:

# cd /etc/sfw

# cp swamba.conf-exampel samba.conf

Create a control script /opt/local/lib/svc/method/samba which contains

#!/sbin/sh

#

case "$1" in

start)

/usr/sfw/sbin/smbd -D

/usr/sfw/sbin/nmbd -D

;;

stop)

pkill smbd

pkill nmbd

;;

*)

echo "Usage: $0 { start | stop }"

exit 1

;;

esac

exit 0

The manifest in /root/samba/samba.xml should contain

<?xml version='1.0'?>

<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>

<service_bundle type='manifest' name='WISWsamba:samba'>

<service name='site/samba' type='service' version='0'>

<create_default_instance enabled="false"/>

<single_instance/>

<!--

First of all, if the config file is not present,

then we needn't bother with anything else.

-->

<dependency name="config-file" grouping="require_all" restart_on="none" type="path">

<service_fmri value="file:///etc/sfw/smb.conf"/>

</dependency>

<!--

If there's no network, then there's no point in running

-->

<dependency name='loopback' grouping='require_all' restart_on='error' type='service'>

<service_fmri value='svc:/network/loopback:default'/>

</dependency>

<dependency name='physical' grouping='optional_all' restart_on='error' type='service'>

<service_fmri value='svc:/network/physical:default'/>

</dependency>

<!--

Since Samba may be providing a home directory service,

it is as well that we ensure that the file-systems are

all mounted before it is started. This is not essential

but in general it is a good thing and doesn't really hurt.

-->

<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>

<service_fmri value='svc:/system/filesystem/local'/>

</dependency>

<!--

now we have the start stop and refresh methods

-->

<exec_method name='start' type='method' exec='/opt/local/lib/svc/method/samba start' timeout_seconds='60'>

<method_context/>

</exec_method>

<exec_method name='stop' type='method' exec='/opt/local/lib/svc/method/samba stop' timeout_seconds='60'>

<method_context/>

</exec_method>

<property_group name='samba' type='application'>

<stability value='Evolving'/>

</property_group>

<property_group name='startd' type='framework'>

<propval name='ignore_error' type='astring' value='core,signal'/>

</property_group>

<stability value='Evolving'/>

<!--

A description of the Service

-->

<template>

<common_name>

<loctext xml:lang='C'>Samba Server</loctext>

</common_name>

<documentation>

<manpage title='samba' section='1M'/>

<doc_link name='samba.org' uri='http://httpd.samba.org'/>

</documentation>

</template>

</service>

</service_bundle>

Import the manifes

# svccfg import /root/samba/samba.xml

Start Samba

# svcadm enable samba

SWAT Setup

First, add an entry in /etc/services for swat:-

swat901/tcp # Samba Web Administration Tool

now, create a file containing a valid inted.conf-style entry for swat, for example /inet.swat:

# echo swatstreamtcpnowaitroot/usr/sfw/sbin/swatswat>>inet-swat

Now run inetconv as follows:-

# inetconv -i inet-swat

swat -> /var/svc/manifest/network/swat-tcp.xml

Importing swat-tcp.xml ...Done

Now swat can be enabled (Note the service name):-

# inetadm -e svc:/network/swat/tcp:default

List the service as follows:-

# inetadm-lsvc:/network/swat/tcp:default

SCOPENAME=VALUE

name="swat"

endpoint_type="stream"

proto="tcp"

isrpc=FALSE

wait=FALSE

exec="/usr/sfw/sbin/swat"

user="root"

default bind_addr=""

default bind_fail_max=-1

default bind_fail_interval=-1

default max_con_rate=-1

default max_copies=-1

default con_rate_offline=-1

default failrate_cnt=40

default failrate_interval=60

default inherit_env=TRUE

default tcp_trace=FALSE

default tcp_wrappers=FALSE

Now we can connect to SWAT with the url:

http://<hostname>:901/

Message was edited by:

Tom_Tiger

Tom_Tiger at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 5

Hi Tom,

Thanks you very very very much. You have helped me heaps,

Bless you and live long and happy life. Tom I have been working on samba from past few days and could not find enough help on the web and my supervisor was repeatedly asking me about this, I was in a sort of pressure

Tom in case if I am stuck some where do you mind if I ask you a question. Please feel free to say no. as such your post has help me plenty

I have just started to work as Systems Administrator and I have to work all by my self.

It is sort of a learning curve for me.

Once again thanks very much for your reply

HarrySukumar at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 6

Hi Tom,

Thanks you very very very much. You have helped me heaps,

Bless you and live long and happy life. Tom I have been working on samba from past few days and could not find enough help on the web and my supervisor was repeatedly asking me about this, I was in a sort of pressure

Tom in case if I am stuck some where do you mind if I ask you a question. Please feel free to say no. as such your post has help me plenty

I have just started to work as Systems Administrator and I have to work all by my self.

It is sort of a learning curve for me.

Once again thanks very much for your reply

HarrySukumar at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 7
No problem, feel free to ask, but I am on vacation till 1. Oct, so please be patient.Fritz
Tom_Tiger at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 8
I have successfully configured samba and swat on my Solaris 10 box. Currently I am trying to add my Solaris 10 server to Windows Domain so called the uninet.Your help is greatly appreciated.Thanks
HarrySukumar at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 9

Here are the settings you need in your smb.conf, you can add it over swat:

You need

Workgroup=xxxx

Security=SERVER

Password Server=yyyyy

Should look like:

<code>

[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH

workgroup = uninet

# server string is the equivalent of the NT Description field

server string = <Your Sabmba Server Description>

# Security mode. Defines in which mode Samba will operate. Possible

# values are share, user, server, domain and ads. Most people will want

# user level security. See the Samba-HOWTO-Collection for details.

security = SERVER

netbios name = <your Samba Server Hostname>

encrypt passwords = Yes

password server = <Fully Quilified Name of the Active Directory Server of uninet>

log level = 1

wins server = <IP of your wins server>

</code>

Message was edited by:

Tom_Tiger

Tom_Tiger at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 10
Tom_Tiger, thanks for this information!I'd just like to clarify one point. The control script we create at /opt/local/lib/svc/method/samba needs to be executable. I propose the following addition after the script file contents.# chmod +x /opt/local/lib/svc/method/samba
Salmon1231 at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...
# 11

Have a customer that has an x4500 and they would like to configure SAMBA to work with their Windows boxes. They do not know Solaris or SAMBA. I planned on letting them use SWAT and then also letting them do user authentication on their AD boxes. How can this be done with Solaris 10, with SAMBA not being compiled w/o AD support.

Would this work:

Workgroup=xxxx

Security=SERVER

Password Server=yyyyy

So that they only have to worry about adding users to Windows?

TomZurita at 2007-7-7 1:30:41 > top of Java-index,General,Sys Admin Best Practices...