Running sudo command for a user on the nodes (Rocks)

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.

[[email protected] /]$ ls /home/hduser/ bio  hadoop-2.7.2  hadoop-2.7.2.tar.gz  usr [[email protected] /]$ 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 [[email protected] /]$ sudo ls /home/hduser ls: cannot open directory /home/hduser: Permission denied 

How can I fix that?

Replay

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).

Category: centos Time: 2016-07-29 Views: 1
Tags: sudo centos

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.136 (s). 12 q(s)