Run Command as Other Users on Linux

0
166

In Linux, there are a number of situations where running a certain command as another user is necessary. It’s especially true in the professional/enterprise environment where there are a number of users. This method is also useful if one user doesn’t have any particular shells.

Running command

For performing the action, you have to follow the following structure –

For example, I have Apache installed and there’s a PHP file at the location “/var/www/html”. In order to run the file as user “viktor”, the following command will be necessary –

Enjoy!

Spread the love
  • 6
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here