How to Set Up Samba in the OpenSolaris 2009.06 Release

How to Set Up Samba in the OpenSolaris 2009.06 Release

Samba is a software suite that provides file and print services to Microsoft Windows clients. Samba can be hosted on any number of platforms. This "How To" describes using Samba in the OpenSolaris release.

To get Samba up and running is fairly simple, especially in a home environment, where you are sharing data or printers between a system that is running OpenSolaris and a Windows client.

You can configure Samba one of two ways:

  • From the command line
  • By using the Samba Web Administration Tool (SWAT)

This "How To" provides instructions for configuring Samba both ways. For users uncomfortable with editing files, the SWAT configuration is recommended, as it is web-based and displays all of the possible settings, along with a concise help feature.

Before You Begin

To get started, use the Package Manager to install the SUNWsmba package. More details about installing Samba are provided in the task sections that follow.

Note
To ensure a successful installation, your UNIX and Windows user name and passwords should match. There are methods for mapping user names and for syncing passwords. These methods are not described in this "How To". Also, make sure that all of your printers are installed before starting the configuration, Samba will gather printer information from the /etc/printers.conf file.
How to Configure Samba With SWAT

1. Enable swat. Open a terminal window and assume the root role.

$ su root
# svcadm enable swat

2. Check to make sure SWAT is online.

# svcs -a | grep swat

3. Launch your web browser and point to http://localhost:901.
4. Log in to the site as root, with your root password.

Note
The SWAT login requires root privileges.
In the OpenSolaris release, the root account is a role that conforms to Role Based Access Control (RBAC).
If you have not done so already, type the following command to
assume the root role before attempting to log in to SWAT.
$ rolemod -K type=normal root

After you log in, you are located in the SWAT home screen.

5. Click the GLOBALS icon at the top of the SWAT home screen.
6. Set the GLOBAL parameters as follows:

  • workgroup = Set to your home workgroup.
    You can get this information from your Windows client. The workgroup will probably be something like WORKGROUP or MSHOME.
  • security = User
  • encrypt passwords = Yes

7. After these parameters are set, click "Commit Changes".
If you have any questions about these options, click Help.
8. Set the following SHARES parameters:

  • comment = Home Directory
  • path = /export/home/%u
  • read only = No
  • browsable = Yes
  • available = Yes

Shares can be any file system that is on the system. This "How To" concentrates on home directories.

9. Click "Commit Changes".

Note
The "%u" in the path statement translates to the UNIX username that the client is using for this connection. If you have usernames that are different, you will need to create a username map and set it in GLOBALS, under Advanced View > Security Options > username map. See Help for more information.

10. Set PRINTER Parameters.
If you installed your printers before configuring Samba, select your printer from the drop-down list, then click "Choose Printer".
11. Set the following important parameters:

  • comment = Postscript Printer
  • path = /var/spool/samba
  • printable = Yes
  • browsable = Yes
  • available = Yes

12. After you have made your selections, click "Commit Changes".
13. In the Server Password Management screen, type your username, password, and re-type your password.

14. Select "Add New User".
The screen displays "Added User: <username>".

To reduce the number of open ports you have, when you are not using SWAT, disable it.

How to Configure Samba From the Command Line

1. Open a Terminal and assume the root role.
2. Copy the example file to the smb.conf file and open it with an editor.

# cd /etc/sfw
# cp smb.conf-example smb.conf
# vi smb.conf

3. To make the setting active, remove any settings that begin with ";", as these are disabled. The template includes full comments for each setting.
4. Modify are the following settings:

  • [global]
    • workgroup = Change to your WORKGROUP.
  • [homes]
    • path = Add your path to your home directories ( /export/home/%u ).
    • browsable = Change to yes to allow the home share to be seen by the browser service.

5. Use the smbpasswd command to add your username.

# smbpasswd -a <username>
New SMB password:
Re-Type New SMB Password:
Added user <username>

You are ready to start Samba.

How To Start Samba

1. Enable the samba and wins services.

# svcadm enable samba
# svcadm enable wins

2. Check that the daemons are online:
For example:

# svcs -a| grep wins
online         16:06:20 svc:/network/wins:default
# svcs -a | grep samba
online         16:06:20 svc:/network/samba:default

You should now be able to access your home directory and your printers from your Windows client.

If you've set browsable = yes in your smb.conf file, you should see the shares in Network Neighborhood.

Alternatively, you could map your home directory to always mount at login.

Special Notice for Windows Vista and Windows 7 Users

Microsoft Knowledge Base Article ID 954387

Note
For certain versions of Vista and Windows 7, Microsoft changed the default security profile for NTLM authentication, this in effect breaks Samba.

To fix this problem, follow these steps:

  1. Select Start > Run and type secpol.msc.
  2. Navigate to Local Policies > Security Options
  3. Right Click "Network Security: LAN Manager authentication level" and select Properties.
  4. Select "Local Security Settings".
  5. Change the Policy to "Send LM & NTLM - user NTLMV2 session security if negotiated".
  6. Click OK and quite the Security Policy Editor.
  7. Log out and then back in or reboot your system.

You should now be able to access your Samba shares and printers.

Related Information

Labels

sundoc sundoc Delete
appdeveloper appdeveloper Delete
configuring configuring Delete
admin admin Delete
task task Delete
singleadmin singleadmin Delete
smallsiteadmin smallsiteadmin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 02

    Aslan7147 says:

    You missed an important step you need to add in step four that to allow a login ...

    You missed an important step you need to add in step four that to allow a login in Swat as the root user you must be the root user in the terminal, and then enter

    rolemod -K type=normal root

    Without stating that the above is worthless to a person unfamiliar with the unix command line, and if it was ever important that the root user not be able to log in normally then perhaps you ought to include whatever the command to dissalow the above is at the end of the document.

    And heck, how was I supposed to find Swat anyhow? When I was looking through the various things related to Samba in the menus there was no sign of it. I stumbled on it after my sixth or so random Google search.

    Being a Windows and Mac user with a good understanding of both operating systems trying to get things working in OpenSolaris is quite the headache. From missing OS features, "find files" in the places menu to missing help files where there are buttons for help, to failing to tell you there is no help file half the time where there isn't. If I could get ZFS anywhere else I wouldn't have put six hours into trying to set up Windows file sharing.

    OpenSolaris is probably a great OS, I just can't figure out how to make it work.

    1. Sep 03

      jheieck says:

      Hi, Thanks for the valuable feedback. I'll look into updating the page for the...

      Hi,

      Thanks for the valuable feedback. I'll look into updating the page for the next release,
      and if possible, for this release. Sorry you're having issues with setting up your OpenSolaris
      environment. It's probably not much consolation to you at this point, but when you
      provide comments like these, it helps make the documentation better. We strive to have
      the documentation provide the kinds of information that will
      enhance every type of user's experience with the OpenSolaris release.

      Again, much appreciated. Feel free to add further comments.

      Nita

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact