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 *

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

This website stores some user agent data. These data are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to opt-out of any future tracking, a cookie will be set up in your browser to remember this choice for one year. I Agree, Deny
602