Home  >  Article  >  System Tutorial  >  How to use NFS to implement flying pigeon transfer in Linux

How to use NFS to implement flying pigeon transfer in Linux

王林
王林forward
2023-12-30 00:00:04591browse
Introduction nfs is a network file system, which can realize file sharing between different hosts, just like Windows’ Network Neighborhood! How to implement this function in linux? It is also very simple to implement its function, just install the nfs package (redhat is installed by default) and configure its corresponding files!

NFS server: 182.207.129.74
NFS client: 182.207.129.75 and 182.207.129.186

1. Check the installation status of the installation package
# rpm -q nfs-utils rpcbind

How to use NFS to implement flying pigeon transfer in Linux

Note: RedHat 5.x checks portmap, redhat 6.x checks rpcbind

2. 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 and exit

How to use NFS to implement flying pigeon transfer in Linux

3. Start rpcbind service
# service rpcbind start  或者  service rpcbind restart

How to use NFS to implement flying pigeon transfer in Linux

4. Start nfs service
# service nfs start  或者  service nfs restart

How to use NFS to implement flying pigeon transfer in Linux

5. Query the NFS share status on the NFS server
# showmount -e
6. Modify the attributes and user permissions of the NFS server-side mounted file
# chown -R cams:cams /home/cams/

# chmod -R 755 /home/cams/

At the same time, ensure that the uid and gid of each server user are consistent. Because the user already exists, modify the uid and gid.

# usermod -u 500 cams

# groupmod -g 500 cams
7. Query the NFS share status on the NFS client
# showmount -e  NFS服务器IP

How to use NFS to implement flying pigeon transfer in Linux

How to use NFS to implement flying pigeon transfer in Linux

8. Mount the shared directory on the NFS server on the NFS client
# mount  NFS服务器IP:共享目录  本地挂载点目录

# mkdir -p /home/cams/file

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

# mount | grep nfs

problem solved:

1. After mounting, both the user and user group are nobody

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

How to use NFS to implement flying pigeon transfer in Linux

The above is the detailed content of How to use NFS to implement flying pigeon transfer in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete