Help Center/ Scalable File Service/ FAQs/ SFS Mount/ How Do I Mount a General-Purpose File System to a Linux ECS as a Non-root User?
Updated on 2025-12-12 GMT+08:00

How Do I Mount a General-Purpose File System to a Linux ECS as a Non-root User?

Scenarios

By default, a Linux ECS only allows root to mount general-purpose file systems using the mount command, but you can grant the permissions of root to other users. Such users can then mount the file systems using the mount command.

The following describes how to grant the permissions of root to a non-root user and mount a general-purpose file system to a Linux ECS as the non-root user. EulerOS is used in this example.

Mounting a File System as a Non-root User

  1. Log in the ECS as user root.
  2. Assign the permissions of root to a non-root user.

    1. Run chmod 777 /etc/sudoers to make the sudoers file editable.
    2. Use the which command to view the mount and umount command paths.
      Figure 1 Viewing command paths
    3. Run vi /etc/sudoers to edit the sudoers file.
    4. Add a user under root. In this example, user mike is added.
      Figure 2 Adding a user
    5. Press Esc, enter :wq, and press Enter to save and exit.
    6. Run chmod 440 /etc/sudoers to make the sudoers file read-only.

  3. Switch to the user mike and log in to the ECS.
  4. Mount the file system. Table 1 describes the mount parameters.

    sudo mount -t nfs -o vers=3,timeo=600,nolock <mount-point> <local-path>

    Table 1 Parameter description

    Parameter

    Description

    <mount-point>

    The format is <file-system-domain-name>:/<file-system-name>, for example, xxx:/sfs-name-001.

    NOTE:

    Variable x is a digit or letter.

    If the mount point is too long to display completely, you can adjust the column width.

    <local-path>

    A local directory on the ECS used to mount the file system, for example, /local_path.

  5. View the mounted file system.

    mount -l
    If the command output contains the following information, the file system has been mounted:
    example.com:/share-xxx on /local_path type nfs (rw,vers=3,timeo=600,nolock,addr=)