To run a command as another user the following would normally suffice:

su -c '/path/to/command --switches ' user

For a user with no login shell, it is possible to specify the shell to use:

su -s /bin/bash -c '/path/to/command --switches' user

Categories: LinuxPosts

Leave a Reply

Your email address will not be published. Required fields are marked *