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

Avatar placeholder

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.