linux - How do I run a program installed by root as a non-root user?

05
2014-04
  • hari

    I'm really a novice in Linux. I'm currently running an OpenSUSE version and I would like to run a program that was installed by root as a non root user.

    In other words, how do I configure the "sharing" settings to run this program as a non-root user?

  • Answers
  • Rich Homolka

    It doesn't matter who installed the binary, it matters what the permissions are.

    To run the file, UNIX would: check to see if you are the file owner: if so, do you have execute perms?

    If not the file owner, are you in the same group: if so, do you have execute perms?

    If neither owner or in the group: Does 'other' have execute perms?

    Most software installed by 'make install' would give execute perms to all of user, group, and other, and you must by definition be in one of those groups.

    What does ls -l say?

    (*) Small caveat, to execute the file, you need execute perms, but to even see it you need perms on the directories that contain the file as well. This is rare, and I'm sure the executable permissions are more important at this point.

  • choroba

    Just change the access rights:

    chmod a+x file
    

    But be careful. How did you install the program? Normally, programs install (through rpm or make install) with sufficient and correct rights.


  • Related Question

    windows - Allowing non-admins to run programs as admins
  • Lev

    How can I enable non-admin users to run a certain application (in my case, a script) with admin permissions on Windows XP?

    This would be similar to the setuid bit on *nix.


  • Related Answers
  • ta.speot.is

    There may be a better way to do this, but:

    1. Create an administrator account dedicated for this purpose
      -> Users can now right click and do "Run As"
    2. Apply group policy for that administrator account so they can only run the processes required

    You may also want to add the administrator account to "Deny Login Locally" and "Deny Login Remotely", so they can't log in. However I do not know if this prevents them from using "Run As" command.