Home > System Tutorial > LINUX > body text

How to use NFS to implement flying pigeon transfer in Linux

王林
Release: 2023-12-30 00:00:04
forward
593 people have browsed it
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
Copy after login

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
Copy after login

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
Copy after login

How to use NFS to implement flying pigeon transfer in Linux

4. Start nfs service
# service nfs start  或者  service nfs restart
Copy after login

How to use NFS to implement flying pigeon transfer in Linux

5. Query the NFS share status on the NFS server
# showmount -e
Copy after login
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/
Copy after login

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
Copy after login
7. Query the NFS share status on the NFS client
# showmount -e  NFS服务器IP
Copy after login

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
Copy after login

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!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template