Cyril

Server Config

NFS

*nix to *nix fileshare protocol nfs-share setup, Performed on Fedora 29 server & client

Fedora:

Install

dnf -y install nfs-utils rpcbind

start (& enable) the service

systemctl start rpcbind
systemctl enable rpcbind  

show available mounts from server (must specify server)

showmount -e 192.168.0.13

start (& enable) the service(s)

systemctl start nfs-server rpcbind rpc-statd nfs-idmapd
systemctl enable nfs-server rpcbind

openSUSE

Install (MicroOS,Aeon)

transactional-update pkg in -t pattern file_server

Install (Tumbleweed,Leap)

zypper in -t pattern file_server

The NFS server is not part of the default installation
(Suse docs:22.2)

The configuration files for the NFS export services:
/etc/exports
/etc/sysconfig/nfs
(SUSE docs:22.3.2)

start/enable associated services

systemctl restart nfsserver
systemctl enable nfsserver

Distro-agnostic

/etc/idmapd.conf
uncomment & enter domain-name <- same name as used in server idmapd.conf

Domain = sameDomainNameHere

Configure what is exported, access permissions, and with-whom to share
/etc/exports

/storage/share 192.168.1.0/24(rw,sync,subtree_check)
#NOTE: all users must have uid & gid defined the same on all machines, or strange things happen with the share (like question-marks instead of permissions displayed)   

…or options per kodi.wiki.nfs

/storage/share 192.168.9.0/24(rw,sync,all_squash,anonuid=1001,anongid=1306,subtree_check)

Configure firewall to allow client servers to access NFS shares

firewall-cmd --permanent --add-service nfs
firewall-cmd --permanent --add-service mountd
firewall-cmd --permanent --add-service rpc-bind
firewall-cmd --reload

Verify shares export as expected

exportfs -rav

Info: http://www.troubleshooters.com/linux/nfs.htm

Samba

Windows to *nix fileshare protocol

Fedora

dnf install samba samba-client samba-common

openSUSE
[ samba guide ]
[ https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.samba.html ]

Configure
(backup original conf file)
/etc/samba/smb.conf

netbios name = dubserv
hosts allow = 127.0.0.1 192.168.9.0/24
workgroup = WORKGROUP
add/configure share entry(ies)
[dubstuff]
    comment = media 640 as ext4
    path = /storage/dubstuff
    valid users = @royalty
    create mask = 0775
    create mode = 0775
    browsable = yes
    writable = yes
    read only = no

[media]
    comment = media 3tb as ntfs
    path = /storage/share
    valid users = @smbgrp,@guests,@royalty
    browsable = yes
    writable = yes
    read only = no

Configure firewall to allow samba service

firewall-cmd --permanent --add-service=samba
firewall-cmd --permanent --add-service=samba-client
firewall-cmd --reload

SEManage the shared directory

dnf install policycoreutils-python-utils
semanage fcontext -a -t samba_share_t '/path/to/goods(/.*)?'
restorecon -Rv /path/to/goods

If shared volume is NTFS partition: edit NTFS fstab entry

context=system_u:object_r:samba_share_t:s0

Samba Users, groups, & permissions

User:

groupadd samba #Create a new group  
usermod -a -G samba cyril #add secondary group to existing user  
useradd cyril -G samba #Create a new user & add to smbgrp  
smbpasswd -a cyril #Create a Samba password for the user  
smbpasswd -e cyril #Enable Samba user  

Filesystem:

chmod -R 0770 /path/to/goods #Change the permissions of the folder  
chown -R root:samba /path/to/goods #Change the ownership of the folder  

Test the newly saved entry & restart samba services

testparm
systemctl restart smb nmb

Works? then enable both smb & nmb services

systemctl enable smb nmb

nmb service is avc denied when selinux is enforcing ?

ausearch -c 'nmbd' --raw | audit2allow -M my-nmbd
semodule -i my-nmbd.pp
systemctl restart nmb

<=========>

Client Config

Software

Method: fstab

Connecting via entry appended to /etc/fstab

https://linoxide.com/file-system/example-linux-nfs-mount-entry-in-fstab-etcfstab/
-Arch wiki: Mount using /etc/fstab with systemd
see fstab archive for more examples

more _netdev stuff
See [fstab archive] for more examples

Client: Windows:

another method
thorough method
Map drive letter to samba share
Map a drive letter via CLI

**https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-setup-nfs-server-on-centos-7-rhel-7-fedora-22.html https://www.server-world.info/en/note?os=Fedora_28&p=nfs&f=1 https://www.server-world.info/en/note?os=Fedora_28&p=nfs&f=2 https://linuxconfig.org/how-to-configure-a-nfs-file-server-on-ubuntu-18-04-bionic-beaver#h7-2-configure-your-exports https://www.tecmint.com/how-to-setup-nfs-server-in-linux/ https://blackcatsoftware.us/fedora-27-configure-nfs-server-and-client/

domain name info: https://www.lifewire.com/everything-you-need-to-know-about-the-domainname-command-4066531