0. online help
man smb.conf [ search "hosts allow" ]
man smbclient
1. Cheat-sheet
1.1 Server Side
- smb.conf
[common]
path = /common
browseable = yes
hosts deny = all
hosts allow = 192.168.100. 127.
write list = user1, @grp1
read list = user2, user1
- selinux
# all share must be with type samba_share_t
semanage fcontext -a -t smaba_share_t "/common(/.*)?"
restorecon -Rv /common
- file system ACL
# These acl should be consistent to "write/read list" in smb.conf
setfacl -m u:user1:rwx /common
setfacl -m d:u:user1:rwx /common
setfacl -m u:user2:rx /common
setfacl -m d:u:user2:rx /common
1.2 Client Side
- smbclient
# List share/service on server
smbclient -L server-ip
# Login as user/pwd to server-ip to access "service"
smbclient -U user%pwd //server-ip/service
# get/put file to samba share
smb: \> get filename
smb: \> put filename
- /etc/fstab
//192.168.100.30/multi /mnt/multi cifs username=user2,password=password,sec=ntlmssp,multiuser 0 0
- login as "user1" to test
su - user1
cifscreds add 192.168.100.30
No comments:
Post a Comment