sudo rootsh on AIX 7

420 Views Asked by At

I'm allowed to use

"sudo /usr/bin/rootsh -i -u user_X"

but furthermore I want to do something like:

echo 'date' | sudo /usr/bin/rootsh -i -u user_X

Here I get the following answer:

no tty/pty on stdin: Not a typewriter

Any ideas how to solve my question? Thanks in advance!

1

There are 1 best solutions below

0
On

It depends on what actually was granted to your user.

If the command "/usr/bin/rootsh" was granted without any arguments, then you may use sudo /usr/bin/rootsh -i -u user_X "date" to execute the date command as root.

If the command "/usr/bin/rootsh -u -u user_X" was granted with all these arguments (and no other form, other list of arguments), then you may not launch any other commands because additional arguments are not be allowed.

You can use "sudo -l" to display what exactly you are allowed to execute and which form of the "rootsh" command exists. If you update the question with output of "sudo -l" then it might be possible to provide a more detailed answer.