Book Image

Webmin Administrator's Cookbook

By : Michal Karzynski
Book Image

Webmin Administrator's Cookbook

By: Michal Karzynski

Overview of this book

Table of Contents (19 chapters)
Webmin Administrator's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Executing a command as another user


Sometimes, it's useful to execute commands as another user. For instance, management commands for some services are, by default, accessible to the system user associated with the service. You may also wish to test whether a user account is configured correctly and execute a command as another user to check if it will work as expected.

Getting ready

In this recipe, we will create a new PostgreSQL database named testdb by issuing the createdb command that is available to the postgres user. If you do not have PostgreSQL installed yet, you may refer to Chapter 10, Running a PostgreSQL Database Server, for information about installing and running this database system.

How to do it...

To execute a command as another user, we will use the Running Processes module:

  1. Navigate to System | Running Processes.

  2. Select Run.. in the Display line.

  3. Enter createdb testdb in the Command to run textbox.

  4. Select Wait until complete as Run mode.

  5. Enter postgres in the Run as user textbox...