Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Running script for different users

    i have a server where i run some gaming servers, and we have 4 Moderators and all of them will get there own user on the server. Is it possible for me to make them run a script from another user?

    is it possible to make a script like this

    su [USER]
    pass [Pass]
    cd /home/[userfolder]/

    Will this make it possible to run a script from another user?

  2. #2
    you could do it like that, but instead, look at using sudo. it is particularly attractive b/c you can run it w/o being prompted for a password, if you choose. here is an example sudo entry:

    user1 ALL = (user2) NOPASSWD: /home/user2/
    The user1 user would then run the following command:
    sudo -u user2 /home/user2/
    you use the visudo command (as root) to edit the config file (usually /etc/sudoers).

    run man sudo, man visudo, and man sudoers for more details and syntax.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts