To do so, use the following syntax: $ sudo ufw allow from to any port nfs You have to add the rule that allows traffic from the specified clients to the NFS port. Now it is important to verify that the server is open for the clients to access the shared content. Then restart the NFS Kernel server in order to apply the configuration changes. To do so, run the following command in Terminal: $ sudo exportfs –a Next in this step, you will have to export the shared directory listed in /etc/exports. no_subtree_check: no subtree checking Step 4: Export the shared directory.sync: write any change to the disc before applying it.The parameters (rw,sync,no_subtree_check) in above file means the client has the following permissions: Once done with editing the /etc/exports file, press ctrl+O to save and ctrl+X to exit the file. ![]() Here, we are specifying the whole subnet for clients to allow them access to our shared directory. In order to allow access to multiple clients by specifying a whole subnet, add the following line in it: /mnt/sharedfolder subnetIP/24(rw,sync,no_subtree_check) ![]() mnt/sharedfolder client2IP(rw,sync,no_subtree_check) In order to allow access to multiple clients, add the following line in it: /mnt/sharedfolder client1IP(rw,sync,no_subtree_check) In order to allow access to a single client, add the following line in it: /mnt/sharedfolder clientIP(rw,sync,no_subtree_check) Use the following format to assign access to clients: directory hostname(options) In order to edit the /etc/exports file using the nano editor, run the following command as sudo in Terminal: $ sudo nano /etc/exports Here you can specify the directories that you want to share with your clients along with the hostname of clients. The configuration file for the NFS server is located at the /etc/ directory. It will allow all clients to access the shared folder. Then apply new permission that allows everyone read, write and execute access. Run the following command to do so: Advertisement $ sudo chown nobody:nogroup /mnt/sharedfolder To allow all clients access permission to the export directory, you will need to remove restrictive permissions. Run the following command by mentioning the export directory path as follows: $ sudo mkdir –p /mnt/sharedfolder Here we are creating an export directory with the name “sharedfolder” in the /mnt directory. Now we have to create an export directory that will be used to share with the client’s systems. Hit y to confirm and the installation will be started in your system. The system might provide you with a Y/n option to confirm the installation. Once updated, install NFS Kernel server by running the following command in Terminal: $ sudo apt install nfs-kernel-system Follow the below steps to do so: Step 1: Install NFS Kernel Serverīefore proceeding towards the installation of NFS server, update your system repository index by running the following command in Terminal: $ sudo apt-get update To setup a host system for sharing directories, we will have to install the NFS Kernel server in it. ![]() We have run the commands and procedures mentioned in this article on a Debian 10 system. ![]() In this article, we will explain the process of setting up an NFS server and client on a Debian system so that you can share files between remote systems. Clients can then access the mounted files based on specific permissions (read, write) assigned to those files.Ĭreating the NFS client-server setup is a simple task that can be performed in a few steps – installation, export, mounting, and access. NFS allows users or system administrators to mount all or part of a server’s file system on the client’s system. It is a client-server setup where the system that shares storage is called the server, while the system that accesses storage stored on a server is called the client. NFS (Network File System) is a file system protocol that allows users to view and access files and folders on a remote system as if they were stored locally.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |