0

I am having a C executable in AIX system by which I can run the command through any user like root or system users. script having below permissions.

On AIX server

lrwsrwxrwx 1 root system   24    Mar 2016 /var/srty/bin/switchuseridprogram -> /opt/switchuseridprogram
-rwsr-sr-x 1 root mrc    5024 Jul 20 2015 /opt/switchuseridprogram

Example usage

/var/srty/bin/switchuseridprogram root 'chown mtest1:dba /mprt/setup/test.log'

Now I am preparing one RHEL system and I don't have source code of that C executable, and I want to use the same functionality in that RHEL system without using sudo.

How to do it?

closed as too broad by muru, Jeff Schaller May 10 at 13:40

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Why don't you want to use sudo? You do know it can be configured to permit only certain users or groups to run riot commands, don't you. And also that it doesn't have to require a password. (Unless you want it to.) – roaima May 7 at 20:11
  • You have limited options without sudo or the source to your program. Reinventing your program is out-of-scope here. – Jeff Schaller May 10 at 13:40
2

Try sudo. For example:

sudo chown mtest1:dba /mpart/setup/test.log

For more details on how to use and configure sudo run man sudo.

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