0

I have a ksh script I am developing for work. (I am on the newer side to shell-scripting)

I have root access but the future-users of this script will not. Say the other user is named User1.

Within the script are commands to other executables in the system. These executables throw "permission denied" for User1 when User1 runs the script. How can I temporarily allow User1 to access the executables in the script? Not just access, but actually run the commands.

I have tried using many variations of umask This has helped with creating and reading files within the script, but doesn't have any affect on executing the necessary commands. I have also tried using chmod but that command in itself is not accessible by User1 either, and therefore throws an error when the script is run. Is there any way you can think of to go about this?

Some Background:

  • AIX(Putty)
  • $ oslevel; 7.2.0.0
  • ksh93

The Script:

#!/bin/ksh
# My Script Introduction
........
# commands from /bin that deny permission to User1
.....

exit

KSH syntax only please. Thank you so much in advance for any help or insight you can provide me.

3
  • 1
    umask or chmod are inappropriate tools. Read man sudo sudoers.
    – waltinator
    Oct 13, 2021 at 21:38
  • @waltinator both sudo and sudoers are not found or not installed in my environment. Do you have any other ideas?
    – Hugobop
    Oct 13, 2021 at 23:35
  • 1
    More details are required. What programs does User1 need to run? Why do they need to run them - i.e. what is the purpose of your script? Note: without something like sudo, the only way to let a normal, non-root user do root-required tasks like formatting or mounting or unmounting a fs is to use su and give them the root password (or put them in the wheel group - if AIX has one, I don't know). That's why tools like sudo were created - to allow for much finer control over exactly who is allowed to do exactly what, while su is pretty much all-or-nothing.
    – cas
    Oct 14, 2021 at 6:39

1 Answer 1

0

I figured out a work around.

The commands that User1 cannot access are scripts themselves. So I am manually implementing the logic from those scripts into my script. This allows allow User1 to do the desired behavior of the commands without actually calling the commands.

Thank you all for your time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .