Getting Started With the Solaris CIFS Service
From Genunix
Contents |
Getting Started With the Solaris CIFS Service
Caution - This is a beta release of the Solaris[tm] Common Internet File System (CIFS) service for evaluation and OpenSolaris[tm] development. Do not use this service in a production environment where service availability and data reliability are required.
This document is intended to get you running the CIFS service on your Solaris system. You should already be familiar with these Solaris utilities. For more information, see the man pages for these utilities and files:
idmap(1M)sharemgr(1M) andsharectl(1M)svcs(1M) andsvcadm(1M)zpool(1M) andzfs(1M)krb5.conf(4)resolv.conf(4)
Solaris CIFS services can operate in two modes: domain and workgroup. These modes are mutually exclusive. Choose one or the other based on your environment and authentication needs.
- If you have an Active Directory (AD) domain and want to give domain users access to the Solaris CIFS service, choose domain mode by joining that domain.
- If you have no AD domains or have no need to support domain users, and you want to use local Solaris users to access the CIFS service, choose workgroup mode by joining the workgroup.
After you have successfully joined a workgroup or an AD domain, you can create and access CIFS shares.
For more information about configuring the identity mapping service and the Solaris CIFS service, see the following chapters of the Solaris CIFS Administration Guide:
This page includes the following procedures, which must be run as superuser or as a user with the "SMB Management" RBAC profile:
- #How to Install the Solaris CIFS Service Software (Solaris Express)
- #How to Install the Solaris CIFS Service Software (OpenSolaris)
- #How to Join a Workgroup
- #How to Join an AD Domain
- #How to Create a CIFS Share
How to Install the Solaris CIFS Service Software (Solaris Express)
You can obtain the software packages for the Solaris CIFS service from the OpenSolaris Download Center.
The Solaris CIFS service packages are available beginning with the Solaris Express Developer Edition 1/08 (SXDE 1/08) and Solaris Express Community Edition build 79 (SXCE b79) releases. Use this procedure if you want to install these packages separately from the operating system.
The Solaris CIFS packages are SUNWsmbskr, SUNWsmbsr, and SUNWsmbsu.
- Download at least the SXDE 1/08 DVD or SXCE b79 image from the OpenSolaris Download Center.
Go to the following URL:
http://www.opensolaris.org/os/downloads
Note - You must be registered at www.sun.com to access the images. - Determine the device to be used for mounting the image file.
# lofiadm -a sol-nv-bn-arch-dvd.iso
Where n is the build number and arch is the architecture of the packages.
For example:
# lofiadm -a sol-nv-b84-sparc-dvd.iso /dev/lofi/1 - Mount the downloaded HSFS image on your system.
# mount -F hsfs device mount-point
device is the device name of the image and mount-point is the directory on which to mount the image.
For example:
# mount -F hsfs /dev/lofi/1 /mnt - Install the Solaris CIFS service packages.
# pkgadd -d mount-point/Solaris_11/Product SUNWsmbskr SUNWsmbsr SUNWsmbsu
Note - Install the packages in the order shown to satisfy package dependencies.
To uninstall the Solaris CIFS service with thepkgrmcommand, reverse the order of the packages shown on thepkgaddcommand line to satisfy package dependencies.
How to Install the Solaris CIFS Service Software (OpenSolaris)
When you have at least the OpenSolaris 2008.05 release installed, you can use the pkg command to install OpenSolaris packages automatically from the OpenSolaris package repository.
Use this procedure if you want to install these packages separately from the operating system.
The Solaris CIFS packages are SUNWsmbs and SUNWsmbskr.
- Log in to the system that is running the OpenSolaris 2008.05 release and become superuser.
- Install the Solaris CIFS service packages.
# pkg install SUNWsmbs
# pkg install SUNWsmbskr
How to Join a Workgroup
- Start the CIFS Service.
# svcadm enable -r smb/server - Join the workgroup.
# smbadm join -w workgroup-name
The default workgroup name isWORKGROUP. If you want to use the default, skip this step. - Establish passwords for CIFS workgroup users.
CIFS does not support UNIX or NIS style passwords. The SMB PAM module is required to generate CIFS style passwords. When the SMB PAM module is installed, the passwd command generates additional encrypted versions of each password that are suitable for use with CIFS.
- Install the PAM module.
Add the following line to the end of the/etc/pam.conffile to support creation of an encrypted version of the user's password for CIFS.
other password required pam_smb_passwd.so.1 nowarn
Note - After the PAM module is installed, thepasswdcommand automatically generates CIFS-suitable passwords for new users. You must also run thepasswdcommand to generate CIFS-style passwords for existing users. - Create local user passwords.
# passwd username
- Install the PAM module.
How to Join an AD Domain
Before You Begin
Determine your name mapping strategy and, if appropriate, create Solaris-to-Windows mapping rules. See "Creating Your Identity Mapping Strategy" in the Solaris CIFS Administration Guide.
Creating name-based mapping rules is optional and can be performed at any time. By default, identity mapping uses ephemeral mapping instead of name-based mapping.
- Start the CIFS Service.
# svcadm enable -r smb/server - Configure the Solaris CIFS service as an AD client.
See "How to Configure an AD Client" in the Solaris CIFS Administration Guide.
This step no longer required as of snv_82. - Ensure that system clocks on the domain controller and the Solaris system are synchronized.
For more information, see Step 3 of "How to Configure the Solaris CIFS Service in Domain Mode" in the Solaris CIFS Administration Guide. - Join the domain.
# smbadm join -u domain-user domain-name
You must specify a user that has appropriate access rights to perform this step. - Restart the CIFS Service.
# svcadm restart smb/server
How to Create a CIFS Share
This procedure describes how to use the ZFS[tm] file system sharesmb property to create CIFS shares. In general, you can use sharemgr to create a CIFS share for any file system, see "How to Create a CIFS Share (sharemgr)" in the Solaris CIFS Administration Guide.
For examples of using the zfs command to create CIFS shares, see "How to Create a CIFS Share (zfs)" in the Solaris CIFS Administration Guide.
Support for CIFS shares requires that ZFS pools be at least Version 9 and that ZFS datasets be at least Version 3.
For information about checking ZFS versions and upgrading ZFS pool and dataset versions, see "CIFS Browsing Fails When sharesmb=on Set on a ZFS Pool" on the
Solaris CIFS Service Troubleshooting page.
- Enable SMB sharing for the ZFS file system.
- Enable SMB sharing for an existing ZFS file system.
# zfs set sharesmb=on fsname
For example, to enable SMB sharing for theztank/myfsfile system, type:
# zfs set sharesmb=on ztank/myfs
Note - The resource name for the share is automatically constructed by thezfscommand when the share is created. The resource name is based on the dataset name, unless you specify a resource name. Any characters that are illegal for resource names are replaced by an underscore character (_).
To specify a resource name for the share, specify a name for thesharesmbproperty,sharesmb=name=resource-name.
For example, to specify a resource name ofmyfsfor theztank/myfsfile system, type:
# zfs set sharesmb=name=myfs ztank/myfs - Create a new ZFS file system that enables SMB sharing.
When creating a ZFS file system to be used for SMB file sharing, set thecasesensitivityoption tomixedto permit a combination of case-sensitive and case-insensitive matching. Also, set thenbmandoption to enforce mandatory cross-protocol share reservations and byte-range locking.
# zfs create -o casesensitivity=mixed -o nbmand=on -o sharesmb=on fsname
For example, to create a ZFS file system with SMB sharing andnbmandenabled for theztank/yourfsfile system, type:
# zfs create -o casesensitivity=mixed -o nbmand=on -o sharesmb=on ztank/yourfs
To specify a resource name for the share, specify a name for thesharesmbproperty,sharesmb=name=resource-name.
For example, to specify a resource name ofyourfsfor theztank/yourfsfile system, type:
# zfs create -o casesensitivity=mixed -o nbmand=on -o sharesmb=name=yourfs ztank/yourfs
- Enable SMB sharing for an existing ZFS file system.
Verify how the new file system is shared.
# sharemgr show -vp
Now, you can access the share by connecting to\\solaris-hostname\share-name. For information about how to access CIFS shares from your client, refer to the client documentation.
