Wednesday, February 12, 2014

Setup SMB on Solaris 11 Journal

https://groups.google.com/forum/#!topic/comp.unix.solaris/RlBJMUnQmIM
http://www.oracle.com/technetwork/articles/servers-storage-admin/solaris-zfssmb-sharing-2390458.html

No following symlinks in shares, unless they are on the same filesystem.

Install SMB on Solaris 11
pkg install service/file-system/smb


How to Configure the SMB Server in Workgroup Mode

Enable the SMB service.
# svcadm enable -r smb/server

(Optional) Change the SMB server to operate in a different workgroup.

# smbadm join -w WORKGROUP

Edit the /etc/pam.conf file to support creation of an encrypted version of the user's password for SMB.
other    password required    pam_smb_passwd.so.1    nowarn

Specify the password for existing local users

# passwd feijiangnan
# cat /var/smt/smbpasswd


How to Create an SMB Share (zfs)
Create a ZFS pool and a mixed-case ZFS file system that supports cross-protocol locking.


# zpool create pool-name vdev
# zfs create -o nbmand=on fsname

Enable SMB sharing for the ZFS file system.
# zfs set sharesmb=on fsname

(Optional) Create an SMB share that has non-default property values or an SMB share for a directory other than the mount point of the dataset.
# zfs set share=name=myshare,path=/mntpnt/directory,prot=smb pool-name/fsname

(Optional) Specify additional SMB share properties.
# zfs set share=name=smb_share,path=/mntpnt/dir2,prot=smb,csc=auto rpool/export/horse

# zfs set share=name=smb_share,prot=smb rpool/export/horse

Verify how the file system is shared.
# cat /etc/dfs/sharetab

# zfs set sharesmb=on rpool/export/horse
# svcadm restart smb/server



# zfs get aclmode rpool/export/home/feijiangnan

NAME                    PROPERTY  VALUE        SOURCE

rpool/export/home/feijiangnan  aclmode   discard  default

# zfs set aclmode=passthrough rpool/export/home/feijiangnan

# zfs get aclmode rpool/export/home/feijiangnan

NAME                    PROPERTY  VALUE        SOURCE

rpool/export/home/feijiangnan  aclmode   passthrough  local

# chmod -R A+user:feijiangnan:read_data/write_data/execute:file_inherit/dir_inherit:allow testdir

# chmod -R A-user:feijiangnan:read_data/write_data/execute:file_inherit/dir_inherit:allow testdir

# chmod -R A+user:feijiangnan:full_set:file_inherit/dir_inherit:allow horse

Hide dot file

root@feifs:/export/horse# ls -a/c
total 16
drwxr-xr-x+  4 root     root           6 Feb  3 10:37 .
                {A------m----}
drwxr-x---   2 root     sys            3 Jan 31 11:02 .$EXTEND
                {AH-S---m----}
drwxr-xr-x   4 root     sys            4 Jan 31 10:45 ..
                {A------m----}
-rw-r--r--+  1 root     root          27 Feb  3 10:37 .profile
                {A------m----}
-rwx------+  1 feijiangnan     staff         15 Feb  3 10:36 abc.txt
                {A------m----}
drwx------+  2 feijiangnan     staff          3 Feb  3 10:37 testdir
                {A------m----}
root@feifs:/export/horse#
root@feifs:/export/horse# find . -name '\.*' -type f -exec chmod S+cH {} \;
root@feifs:/export/horse# ls -a/c
total 16
drwxr-xr-x+  4 root     root           6 Feb  3 10:37 .
                {A------m----}
drwxr-x---   2 root     sys            3 Jan 31 11:02 .$EXTEND
                {AH-S---m----}
drwxr-xr-x   4 root     sys            4 Jan 31 10:45 ..
                {A------m----}
-rw-r--r--+  1 root     root          27 Feb  3 10:37 .profile
                {AH-----m----}
-rwx------+  1 feijiangnan     staff         15 Feb  3 10:36 abc.txt
                {A------m----}
drwx------+  2 feijiangnan     staff          3 Feb  3 10:37 testdir
                {A------m----}


# idmap add -d "winuser:*@*" "unixuser:*"
add -d  winuser:*@*     unixuser:*




No comments:

Post a Comment