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

Linux configures NFS to realize file sharing

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

NFS server: 182.207.129.74

NFS clients: 182.207.129.75 and 182.207.129.186

1. Check the installation of the installation package

# rpm-Q nfs-utils rpcbind

Note: redhat 5.x check portmap,redhat 6.x check rpcbind

two。 Configure the / etc/exports file on the NFS server

Vi / etc/exports

Then enter / home/cams/file 182.207.129.* (rw,sync,no_root_squash,no_all_squash)

Save exit

3. Start the rpcbind service

# service rpcbind start or service rpcbind restart

4. Start the nfs service

# service nfs start or service nfs restart

5. Query the sharing status of NFS on the NFS server

# showmount-e

6. Modify the properties and user permissions of the file mounted on the NFS server

# chown-R cams:cams / home/cams/

# chmod-R 755 / home/cams/

At the same time, it is necessary to ensure that the uid and gid of each server user are the same. Here, because the user already exists, modify the uid and gid.

# usermod-u 500 cams

# groupmod-g 500 cams

7. Query the sharing status of NFS in the NFS client

# showmount-e NFS server IP

8. Mount the shared directory in the NFS server on the NFS client

# mount NFS server IP: shared directory local mount point directory

# mkdir-p / home/cams/file

# mount 182.207.129.74:/home/cams/file / home/cams/file

# mount | grep nfs

Problem solving:

1. After mounting, both users and user groups are nobody

Modify the Domain entry in the nfs server and the client / etc/idmapd.conf file to make the configuration consistent. (if the server is not configured with a domain name, configure the domain name first, and then restart the server)

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