Providing File-based Storage

NFS share with read-write

/share IP range/Prefix(rw,no_root_squash)
no_root_squash allows root to be treated as root vice nfsnobody

NFS server packages

nfs-server
nfs-secure-server (for kerberos)

NFS port

2049

mount NFS share

mount server:/share /mnt/dir

NFS owner

nfsnobody

mount NFS in fstab

server:/share /mnt/dir nfs defaults 0 0

NFS export (secure)

/share IP/prefix(sec=krb5p,rw)

mount NFS export (secure)

mount -o sec=krb5p IP:/share /mnt/dir

Samba packages

samba
samba-client (to create users)

Samba configuration file

/etc/samba/smb.conf

/etc/samba/smb.conf directives

workgour = WORKGROUP
security = user (default)
hosts allow: comma delimited list of hosts
file share sections

hosts.allow examples

172.25.
.example.com
172.25.0.1/24

Samba file share sections

[share]
path=/sharepath
writeable=no
validusers = fred, @managment

Validate SMB conf file

testparm

Set samba password

smbpasswd -a <user>

Samba share permissiosn

2775

Multiuser SMB mount

cifscred add server1
echo ' username=brian' > /root/smb-multiuser.txt
echo 'password=redhat' >> /root/smb-multiuser.txt
//server1/smbshare /mnt/point cifs credentials=/root/smb-multiuser.txt,multiuser,sec=ntlmssp 0 0