Mount NFS appears access denied by server while mounting ... Error

Source: Internet
Author: User

Before this site has introduced how to install and Mount Ubuntu use NFS articles, not clear can go to see. Now there is a need, and then I do it again. Unfortunately, it's not going very well this time. The next step is to record the process. Installation is very simple, no problem. Follow the previous article, first install Nfs-kernel-server on the server side, then create the directory, modify the/etc/exports configuration file, add the directory to be able to mount, start the NFS program. But when I created the directory, I didn't use the nobody user, but I specified a user who has read and write access to the directory. The user has specified UID, GID, the main purpose is that multiple users can use the Nfs-server when the difference.

Before you mount, you need to create the same owner, array user on the client as you would need to mount the directory in NFS server. If you already have the user, modify the user uid, and the group GID is the same as in NFS server

How to modify the Linux user uid, group GID can refer to this article:


The commands for modifying the user UID and group GID are usermod and groupmod, and the idea is simple. Use Usermod to modify the user's UID, then use Groupmod to modify the group's GID, and finally use the Chown and CHGRP commands to modify the owner group of the original user files and directories.

For example, test user foo and test group Foo.

Foo Old uid:1005
Foo New uid:2005
Foo Old gid:2000
Foo New gid:3000

Command:

1, modify the UID of Foo users

# Usermod-u-Foo
2. Modify the GID of Foo Group

# GROUPMOD-G 3000 foo
3. Foo User's home directory the owner and group of the files under the 1, 2 command are automatically modified to the new UID, the corresponding genus of the GID, but other file directories need to be modified manually. Manually modified commands are also relatively straightforward.

# Find/-user 1005-exec chown-h foo {} \;
# Find/-group 2000-exec chgrp-h foo {} \;
This way, the UID and GID of the user and group are modified. You can use the ID command to see if the changes are as we wish.

# ls-l/home/foo/
# id-u Foo
# id-g Foo
# grep FOO/ETC/PASSWD
# grep Foo/etc/group

The last mount Mount, and this time there is a "mount.nfs:access denied by server while mounting ..." error. See no Exception Log output on the NFS server. It is also not because the NFS client port is over 1024 because I have added the insecure parameter to the/etc/exports configuration file.

No way, again Google ... Finally, find a solution in a Web site that specifies that NFS version is V3 on Mount. The mount command finally turns similar to the following, Mount success.

Mount-o v3 192.168.1.100:/path/to/export/path/to/mount

In the final step, you need to have NFS clients automatically mount the NFS directory each time you restart the server. The simple idea is to put the above-similar mount command into the/etc/rc.local file, but the blogger tests to find out. Finally, put the put into the/etc/fstab, the configuration file is similar to the following.

192.168.1.100:/path/to/export/path/to/mount NFS Defaults,v3 1 1

There is a need to add V3 to the options, or there will be problems above.

Toss it over, have a free time to study the next NFS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.