Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Webmin Administrator's Cookbook
Webmin Administrator's Cookbook

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
Profile Icon Michal Karzynski
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (11 Ratings)
Paperback Mar 2014 376 pages Edition
eBook
$25.99 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Michal Karzynski
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (11 Ratings)
Paperback Mar 2014 376 pages Edition
eBook
$25.99 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$25.99 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Webmin Administrator's Cookbook

Chapter 2. User Management

In this chapter, we will cover:

  • Creating a Webmin user

  • Creating a Webmin group with access to specific modules and options

  • Allowing users to log in to Webmin with the system credentials

  • Creating Webmin users based on system accounts

  • Controlling who is currently using Webmin

  • Creating a system user account

  • Modifying a user's UID and other information

  • Temporarily disabling a user account

  • Creating and editing a system group

  • Changing a user's password

  • Exporting users and importing them into another system

  • Installing Usermin

Introduction


Webmin's user management features are quite sophisticated. You can use Webmin to manage users and groups on your system, decide which of them have access to Webmin, and which modules they will be allowed to see. You can also create special Webmin-only users, who will not have regular accounts on your system, but will still be able to access selected Webmin modules.

If you're the main administrator of a system, you can set up Webmin to allow other administrators to modify only selected parts of your system's configuration. For instance, you can allow sub-administrators to configure the Apache web server but not to change other settings. This particular workflow is so common, in fact, that a sibling product to Webmin called Usermin was developed to allow non-administrators access to a Webmin-like environment through which they can access databases, configure web hosts, set up cron jobs, and read local mail.

Note

Webmin distinguishes between two types of users:

  • Unix users (system...

Creating a Webmin user


The simplest way to grant someone access to Webmin is to create a Webmin user account for him/her. You can regulate which IPs the user will be allowed to log in from and even at what times during the week the access will be open. During account creation, you can specify what modules the user will have access to or which group he/she will belong to.

In this recipe, we will create a new user with access to only one module.

Getting ready

We will create a new user account with a single-use password, which the user will have to change after the first login. In order to use this one-time password, we need to enable a feature in Webmin. Perform the following steps to set the password expiry policy:

  1. Go to Webmin | Webmin Configuration | Authentication.

  2. Set the Password expiry policy option to Prompt users with expired passwords to enter a new one.

  3. Webmin's server process will restart; wait for a few seconds before continuing.

How to do it...

Perform the following steps to create a...

Creating a Webmin group with access to specific modules and options


Webmin users should be organized into groups. If you have more then one user whom you would like to equip with the same privileges, creating a group is the way to go. Webmin provides very granular permissions, which you can grant to each group. You can set the following three types of permissions:

  • Specify which Webmin modules are available to a group

  • Set global permissions, which apply to all modules

  • Set module-level access control settings, specifying which options of each module will be available

    Tip

    Permissions for an individual account can be configured with the same level of granularity.

How to do it...

In this recipe, we will create a Webmin group with access limited to viewing log files from the /var/log directory:

  1. To create a new Webmin group, navigate to Webmin | Webmin Users, and click Create a new Webmin group.

  2. Name the new group log_viewers, and supply a group description.

  3. In the Available Webmin modules section, select...

Allowing users to log in to Webmin with the system credentials


Webmin's default settings don't allow regular system users to log in to Webmin, but at least one user is allowed to log in after installation. Depending on the settings included in your Webmin package, that may be any of the following:

  • The root user

  • Users with unrestricted root access via sudo (specifically those with an ALL=(ALL) ALL rule)

  • The user created during manual Webmin installation

In this recipe, we will allow all users of a Unix group to log in to Webmin with limited permissions.

Getting ready

We need to begin by creating a standard Webmin account, which will be shared by all system users we grant access to. Refer to the recipe, Creating a Webmin user, for instructions, and create a Webmin account, named webmin_user, for instance, with specific permissions.

How to do it...

Follow these steps to allow members of a system group to log in to Webmin:

  1. Navigate to the Webmin | Webmin Users | Configure Unix User Authentication screen...

Creating Webmin users based on system accounts


In previous recipes, we talked about creating Webmin users and allowing system users to log in as a chosen Webmin account. You may choose to have a more direct, one-to-one correspondence between Webmin and system accounts. You can achieve this by creating Webmin accounts for selected existing users and setting up account synchronization for users added in the future.

Getting ready

In this recipe, we will create a Webmin account for each system user. All new Webmin accounts will be assigned to a Webmin group. Before we begin, set up a Webmin group following the recipe, Creating a Webmin group with access to specific modules and options.

How to do it...

Our first step will be to create Webmin accounts for existing system users:

  1. Navigate to Webmin | Webmin Users | Convert Unix To Webmin Users.

  2. Select the users you would like to add to Webmin.

  3. Select the Webmin group to assign them to.

  4. Click Convert Now.

Webmin accounts for all selected users should now...

Controlling who is currently using Webmin


Webmin keeps a log of all the actions performed by users. You can inspect a list of currently open user sessions, check what actions were performed during a session, or close a session, forcing the user to be logged out.

How to do it...

Perform these steps to check which users are currently logged into Webmin:

  1. Navigate to Webmin | Webmin Users.

  2. Click the View Login Sessions icon.

  3. To view the actions performed by the user in this session, click the View logs link next to any session.

You can close any session, except your own, and force the user to log in again. To do this, click the link in the Session ID column. The next time this user clicks a link or submits a form, he/she will be asked to log in again.

How it works...

Whenever a user logs in, Webmin creates a session for him/her. A session consists of a specific ID and associated information about who the owner of the session is and whether the session is active.

The session ID is passed to the user's...

Creating a system user account


Creating user accounts in Unix is a multistep process: you need to add user data to system configuration files, create a home directory, copy template files to that directory, and set ownership of those files to the new user. Webmin automates this process for you.

Tip

In addition, if you set up synchronization, a Webmin account will also be created for the new user. Refer to the recipe, Creating Webmin users based on existing system accounts, for more information about account synchronization.

Getting ready

We will create a new user account with a single-use password, which the user will have to change to after the first login. In order to allow the user to change the password through Webmin, go to Webmin | Webmin Configuration | Authentication, and set the Password expiry policy option to Prompt users with expired passwords to enter a new one.

How to do it...

Perform the following steps to create a system user account:

  1. Navigate to System | Users and Groups, and click...

Modifying a user's UID and other information


Modifying basic information about an existing user is usually quite simple. The exception to this rule is the change of a user's UID. This is sometimes necessary if a user has accounts on two different Unix systems and both systems have to identify him/her as the same person. A typical example of this situation is sharing files over NFS as we will discuss in Chapter 6, Managing Files on Your System.

Changing a UID requires an update of file ownership of all files belonging to that user. This can be quite tedious, but Webmin does the job for us.

How to do it...

Follow these steps for modifying a user's UID:

  1. Navigate to System | Users and Groups, and click the username link of the account you want to edit.

  2. On the next page, you will be able to edit all the basic user information, including the username, ID, home directory location, chosen default shell program, primary and secondary system groups, and so on.

  3. Change User ID to a different value.

  4. In the...

Temporarily disabling a user account


If a person stops using your system, it's often a good idea not to delete their account, but rather to disable it. Perhaps you need to preserve data for forensic purposes, the user would need access to your system again in the future or is the owner of files on your system, which you don't want to delete or leave orphaned.

How to do it...

Disabling a user account through Webmin is very easy. Perform the following steps to do so:

  1. Navigate to System | Users and Groups, and click the username link of the account you want to edit.

  2. On the next page, check the box labeled Login temporarily disabled.

  3. Click Save.

    Tip

    You can re-enable the account by following the same procedure. Just uncheck the Login temporarily disabled box, and hit Save.

How it works...

To disable a user account, Webmin updates the /etc/shadow file, which stores hashed user passwords. The password hash for the selected user is prepended with an exclamation point (!). This invalidates the hash and makes...

Creating and editing a system group


Creating and editing system groups through Webmin is very simple; just follow the steps outlined.

How to do it...

Let's start by creating a group as follows:

  1. Navigate to System | Users and Groups, and click through to the Local Groups tab.

  2. Click Create a new group.

  3. On the next page, you will be asked to specify basic group information. Set Group name to a chosen name, and leave Group ID set to Automatic. Ignore the password fields.

  4. You can now add any user you choose to the group by moving them from the left to the right column of the Users widget.

  5. Click Create to finish and create the group.

You can now edit the group by performing the following steps:

  1. Go back to System | Users and Groups, and click the Local Groups tab.

  2. Click the group's link in the Group name column.

  3. You will be brought to a screen with a form similar to the one used to create a group, with one difference. If you now change a group's ID, you can tell Webmin to update files on the system with the...

Changing a user's password


When a user forgets his/her password, he/she will contact you as the system's administrator and request a password reminder. For security reasons, passwords are stored on your system only in the form of cryptographic hashes, not plain text. Because of this, you cannot send passwords to users, but you can reset a password and send the new one to the user. The best practice in such a case is to make the new password usable only once, allowing the user to log in, but requesting that he/she immediately change it to a password of his/her own choice.

In this recipe, we will describe how to reset a user's password to a one-time value.

Getting ready

In order to use single-use passwords in Webmin, we need to enable this feature. Go to Webmin | Webmin Configuration | Authentication, and set the Password expiry policy option to Prompt users with expired passwords to enter a new one.

How to do it...

Perform the following steps to change the user's password:

  1. Navigate to System |...

Exporting users and importing them into another system


When you're setting up another server for your organization, you may need to recreate accounts of multiple users on the new system. Webmin's user management module has the ability to export data about existing user accounts to a special batch file, which you can then import into any other system that also runs Webmin. This allows you to recreate multiple accounts quickly and easily.

How to do it...

In this recipe, we will export selected users from one system (source) and import them into a second system (destination).

Let's start by exporting users as follows:

  1. On your source system, navigate to System | Users and Groups, and click the link marked Export to batch file.

  2. Set Batch file format to Standard passwd and shadow files.

    Tip

    Note that you should use an export format compatible with the destination operating system. Use the Standard format if you're exporting to Linux, but use the BSD, Mac OS, or AIX specific formats if you're exporting...

Installing Usermin


If you would like to make the basic functionality of your system available to its users through an interface similar to Webmin, you can use Webmin's companion product called Usermin. This environment is just as easy to use as Webmin and provides a number of features that do not require administrative privileges:

  • Reading e-mails

  • Setting up mail forwarding and auto-replies

  • Setting up scheduled e-mails

  • Changing passwords

  • Executing system commands

  • Opening an SSH session in the browser

  • Configuring Apache virtual hosts

  • Configuring MySQL or PostgreSQL databases

  • Setting up CRON jobs or scheduled command execution

How to do it...

Installation of Usermin is very simple and using it is analogous to using Webmin. The main difference is that you connect over a different port; the default port for Usermin is 20000.

Let's start by installing Usermin:

  1. If you've installed Webmin from its repository, follow the recipe, Installing software packages from Chapter 1, Setting Up Your System, and install...

Left arrow icon Right arrow icon

What you will learn

  • Learn how to install, configure, and use Webmin
  • Set up file sharing over FTP, SFTP, NFS, and CIFS (Windows Networking)
  • Monitor the state of your server and analyze system logs
  • Get started with popular technologies such as WordPress, Drupal, and Django
  • Learn to manage files and folders on your system
  • Run an Apache web server
  • Set up web applications written in PHP and Python

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 26, 2014
Length: 376 pages
Edition :
Language : English
ISBN-13 : 9781849515849
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Mar 26, 2014
Length: 376 pages
Edition :
Language : English
ISBN-13 : 9781849515849
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 158.97
Network Analysis using Wireshark Cookbook
$54.99
Webmin Administrator's Cookbook
$48.99
Implementing Samba 4
$54.99
Total $ 158.97 Stars icon

Table of Contents

12 Chapters
Setting Up Your System Chevron down icon Chevron up icon
User Management Chevron down icon Chevron up icon
Securing Your System Chevron down icon Chevron up icon
Controlling Your System Chevron down icon Chevron up icon
Monitoring Your System Chevron down icon Chevron up icon
Managing Files on Your System Chevron down icon Chevron up icon
Backing Up Your System Chevron down icon Chevron up icon
Running an Apache Web Server Chevron down icon Chevron up icon
Running a MySQL Database Server Chevron down icon Chevron up icon
Running a PostgreSQL Database Server Chevron down icon Chevron up icon
Running Web Applications Chevron down icon Chevron up icon
Setting Up an E-mail Server Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(11 Ratings)
5 star 18.2%
4 star 72.7%
3 star 0%
2 star 9.1%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Roberto Avilés Jun 12, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A great resource for the people currently working in system administration, or wishing to move into the ‘sysadmin’ area, this book on WEBMIN, an open source (web-bases system configuration tool mainly written in PERL) ‘tool’ that allows us to control a system remotely, through the web, from any computer with a browser, describes in 12 chapters what it takes to use Webmin to get the most of your system, including tips on clustering functions. Chapter 1 is about Setting up you system, Chapter 2 on the User Management, Chapter 3 Securing the System, Chapter 4 about Controlling it, Chapter 5 Monitoring, Chapter 6 about Managing Files, Chapter 7, Backing the System, Chapter 8, Running an Apache Web Server, Chapter 9, Running a MySQL Database Server, Chapter 10, Running a PostgreSQL DB Server, Chapter 11, Running Web Applications and Chapter 12 is about Setting Up an E-mail Server.This well written book contains many examples that will guide you through the many packages and tools Webmin provide. Every chapter is a step-by-step guide through procedures that enable us to install, control and get the most of our specific system. Is a well written book, you will forget this is a technical one and soon it will be your swiss knife on your desktop or shelves, for every problem you need to solve related to the administration of your system.
Amazon Verified review Amazon
Angelo Caruso Jun 08, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Often a Linux appliance, on a real or virtual machine, is the best way to go for effectively put up a service in your network. Then a friendly way to administer this server becomes a primary need, specially if you, as me, are not a system administration guru!Webmin is the best answer I know to this need and its primary advantage is it doesn't add further complexity to the situation.This book covers with a very practical approach most of the tasks you should perform administering a system using Webmin, from installing the webmin tool itself to put up a database or email service, without requiring you to become a guru or even knowing commands and all the complexities behind them.I regret only the book not being available when I began experimenting Webmin, now it is, so I recommend you to get a copy!
Amazon Verified review Amazon
BRANKO BOGUNOVIC Jun 01, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Webmin Amin Cookbook, gives you a good introduction of Webmin tool in everyday administration work. It is mostly suited work Linux based (Debian/Fedora) OS and is good alternative to the some commercial tools such as CPanel.Content of the book is well written and it is easy to follow. Some chapters (3 Securing Your System,5 Monitoring System and 7 Back Up) are very interesting and useful particular from the view where everything is possible to to in Webnin without using bash in the console. However some other chapter in my opinion are just brief introduction to the larger scope databases(MySql and Postgres) and web server(Apache) and I would recommend some other more specialized books on these topics. Overall I recommend this book to everyone how has any kind of connection with administrating Unix based OS.
Amazon Verified review Amazon
Geek On The Hill Jul 20, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
If you're moving from some other Web server control panel to Webmin / Virtualmin, and you're clueless about it, this book will serve as a good introduction to how the Webmin panel works.On the other hand, it's somewhat out-of-date; so although you'll be in a better place than you were before, you'll still have to educate yourself on more recent developments.In fairness, however that's true of pretty much anything in IT. By the time a book gets to press, it's already starting to get obsolete. So if you need to learn Webmin / Virtualmin, this is as good a way as any to start learning as any. Just be aware that you'll still need to bring yourself up to date.Richard
Amazon Verified review Amazon
Amazon Customer Jun 02, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I'm glad some one put out a resource for Webmin. After reading several reviews I came to the conclusion that Webmin was the best software to use for my VPS. This textbook did the trick. A few things I tried didn't work however and I had to search through other documents (hence the 4 stars)... The book is well laid out and maybe jumping around chapters screwed me up. Webmin is a great program if you want a OS alternative to CPanel. Good book for a great program. Give it a try.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.