Non-root users mount NFS

background:

When mounting NFS, sometimes it can only be mounted by the root user, so non-root users are restricted when they want to use it.

Solution:

The first step is to ensure that the premise: root user can mount.

For how to mount NFS, please refer to my other article

https://blog.csdn.net/Kangyucheng/article/details/108279478

The second step is to confirm that a non-root user is used for mounting. Available or created.

For example, this article uses an existing account: kyc

The third step is to log in to the elastic cloud host with the root account.

The fourth step is to add root permissions to non-root ordinary users.

(1) Execute the chmod 777 /etc/sudoers command to modify the sudoers file permissions to editable permissions.

(2) Execute the vi /etc/sudoers command to edit the sudoers file.

Add a common user account under the root account.

(3) After editing, click "Esc" and enter: wq, save the file and exit.

(4) Execute the chmod 440 /etc/sudoers command to restore the sudoers file permissions to read-only permissions.

The fifth step is to switch to the ordinary user kyc to log in to the elastic cloud host and perform the mount.

Execute the following command to mount the file system.

Step 6. After the mounting is complete, execute mount -l to view the mounted file system.

The following results can be found.

Guess you like

Origin blog.csdn.net/Kangyucheng/article/details/108280853