Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Webmin Administrator's Cookbook

You're reading from   Webmin Administrator's Cookbook Over 100 recipes to leverage the features of Webmin and master the art of administering your web or database servers.

Arrow left icon
Product type Paperback
Published in Mar 2014
Publisher
ISBN-13 9781849515849
Length 376 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Michal Karzynski Michal Karzynski
Author Profile Icon Michal Karzynski
Michal Karzynski
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Webmin Administrator's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Setting Up Your System FREE CHAPTER 2. User Management 3. Securing Your System 4. Controlling Your System 5. Monitoring Your System 6. Managing Files on Your System 7. Backing Up Your System 8. Running an Apache Web Server 9. Running a MySQL Database Server 10. Running a PostgreSQL Database Server 11. Running Web Applications 12. Setting Up an E-mail Server 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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image