0

Previously, I asked a question here that a user which is in the sudoers file, want to run some sudo commands on the nodes. The problem, is that with the sudo command, it cannot access its home. Though it can access other folders.

So, on the frontend, we have

# cat /etc/exports
/export 10.10.10.1(rw,async,no_root_squash) 10.10.10.0/255.255.255.0(rw,async)

Now, please see that hduser uses ssh to login to the compute node. It can run sudo command to list / but not its home.

[hduser@compute-0-0 /]$ ls /home/hduser/
bio  hadoop-2.7.2  hadoop-2.7.2.tar.gz  usr
[hduser@compute-0-0 /]$ sudo ls
bin   etc      lib         media  net   root     share  sys  var
boot  home     lib64       misc   opt   sbin     srv    tmp
dev   install  lost+found  mnt    proc  selinux  state  usr
[hduser@compute-0-0 /]$ sudo ls /home/hduser
ls: cannot open directory /home/hduser: Permission denied

How can I fix that?

1

As per the comments, root is denied because of root_squash, which is the default export behaviour. In this mode remote access from root is mapped to nobody.

If all the nodes are meant to be equivalent with no uniqueness then you should simplify the export

/export 10.10.10.0/255.255.255.0(rw,async,no_root_squash)

After making this change, exportfs -a.

If this doesn't immediately solve the problem then the client may need to be restarted (umount, mount the relevant filesystem, or reboot).

  • So that is Rocks! If I change that file, I think I have to run rocks sync config and I think the content of /etc/exports is the default one. So, I want to be sure that modifying that line has no effect on the system configuration. – mahmood Jul 29 '16 at 20:30
  • It will have no effect on host 10.10.10.1 and the other hosts on that subnet will now have root level access to /export where they don't at the moment – Stephen Harris Jul 29 '16 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.