# RedHat - Install NFS Shares

### NFS Server Configuration

#### Install NFS Utilities.  


```bash
sudo dnf install nfs-utils
```

#### Create the Shared Directory.  


```bash
sudo mkdir -p /nfs/exports/myshare
```

(Replace /nfs/exports/myshare with your desired path.)  
Configure NFS Exports: Edit the /etc/exports file to define the directories to be shared and the clients allowed to access them.

```bash
sudo nano /etc/exports
```

Add a line similar to this, replacing client\_ip\_address with the actual IP address or hostname of your NFS client:

```bash
/nfs/exports/myshare client_ip_address(rw,sync,no_root_squash)
```

**rw:** Read/write access.  
**sync:** Synchronous writes to disk.  
**no\_root\_squash:** Prevents root user on the client from being squashed to an anonymous user on the server. Use with caution.

  
Apply Export Configuration.

```bash
sudo exportfs -rav
```

Start and Enable NFS Services.

```bash
sudo systemctl enable --now rpcbind nfs-server
```

Configure Firewall: Allow NFS traffic through the firewall.

```bash
sudo firewall-cmd --permanent --add-service=nfs
sudo firewall-cmd --permanent --add-service=mountd
sudo firewall-cmd --permanent --add-service=rpc-bind
sudo firewall-cmd --reload
```