Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

NFS detailed explanation

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

NFS: Network File System

NFS: protocols, Unix-like systems, file systems (kernel)

SUN:

NFSv1

NFSv2

NFSv3

NFSv4

RPC: remote procedure call

2049/tcp

2049/udp

NIS: Network Information Service

NIS+

Kerberos

RPC: portmapper

Monitor

111/tcp

111/udp

Based on the processes provided by RPC, when starting, you need to register with rpc to listen on a certain port, and rpc will listen from each unused port.

Pick one to listen to this process, that is, a semi-random mechanism:

NFS:

Installation configuration:

Service installer: nfs-utils

Three key processes:

Mountd: mounts the daemon, which is responsible for client source authentication.

Nfsd: file read and write

Idmapd:id mapping process

/ etc/exports:

File system client 1 (File system Export Properties) client 2

Client:

IP: 192.168.1.29

Hostname

Network

File system export properties:

Rw

Async

Sync

Root_squash: compress root users, based on imap, and access root over the network

When converted to a nfsnobody user

No_root_squash: do not compress root users

All_squash: compress all users

Anonuid,anongid: specify anonymous users

Showmount

-e: execute on the nfs client to explore the nfs file system exported by a host, using the format

"showmount-e Server_IP"

-d: executed on the nfs server to show which exported file system has been mounted and used by at least one customer:

-a: display all mount sessions on the nfs server:

Exportfs:

-a: operate all file systems

-ra: re-export all file systems

-ua: cancels all imported file systems

-v: display details

Experiment:

Two test servers:

NFS server: 192.168.1.28

NFS client: 192.168.1.29

1. Create a shared directory / nfsshare on the NFS server

2. Edit the / etc/exports file on the NFS server, configure the shared directory, network segment and shared properties, etc.

3. Restart nfs

4. NFS client explores options for NFS server-side mount

5. The NFS client creates a mount directory / mnt/nfs, and mounts the

6. The NFS client enters the / mnt/nfs directory and creates a file called test.txt, which prompts you to have no permission, as shown below:

7. On the NFS server, add the no_root_squash parameter, do not compress root users, and restart nfs, as shown below:

8. On the NFS client, create a test directory and prompt it to be normal.

9. Create a user testuser of nfs on the NFS server, with a user id of 1000

10. The NFS client creates a new nfs user testuser with a user id of 1000. From the following figure, you can see the value of the user to the / nfsshare file

Normal operation, including creating files, copying files, etc.

11. On the NFS server, use the exportfs command to reload the nfs service

Modify the / etc/exportfs file and re-export using exportfs

12. Use showmount-e to view the exported / nfsshare on the NFS client

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report