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?

roaima
  • 107,089
  • 14
  • 139
  • 261
user3548033
  • 593
  • 2
  • 12
  • 25
  • 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 07 '19 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 '19 at 13:40

1 Answers1

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.

ctt
  • 211
  • 1
  • 5