webmin 安装_如何在Ubuntu 20.04上安装Webmin

webmin 安装

介绍 (Introduction)

Webmin is a modern web control panel that allows you to administer your Linux server through a browser-based interface. With Webmin, you can manage user accounts, configure DNS settings, and change settings for common packages on the fly.

Webmin是一种现代的Web控制面板,可让您通过基于浏览器的界面来管理Linux服务器。 使用Webmin,您可以管理用户帐户,配置DNS设置以及即时更改常见软件包的设置。

In this tutorial, you’ll install and configure Webmin on your server and secure access to the interface with a valid certificate from Let’s Encrypt. You’ll then use Webmin to add new user accounts, and update all packages on your server from the dashboard.

在本教程中,您将在服务器上安装和配置Webmin,并使用来自Let's Encrypt的有效证书来安全访问接口。 然后,您将使用Webmin添加新的用户帐户,并从仪表板上更新服务器上的所有软件包。

先决条件 (Prerequisites)

To complete this tutorial, you will need:

要完成本教程,您将需要:

第1步-安装Webmin (Step 1 — Installing Webmin)

First, we need to add the Webmin repository so that we can install and update Webmin using our package manager. We do this by adding the repository to the /etc/apt/sources.list file.

首先,我们需要添加Webmin存储库,以便我们可以使用包管理器来安装和更新Webmin。 为此,我们将存储库添加到/etc/apt/sources.list文件中。

Open the file in your preferred editor. Here, we’ll use nano:

在首选编辑器中打开文件。 在这里,我们将使用nano

  • sudo nano /etc/apt/sources.list

    须藤nano /etc/apt/sources.list

Then add this line to the bottom of the file to add the new repository:

然后将此行添加到文件底部以添加新的存储库:

/etc/apt/sources.list
/etc/apt/sources.list
. . . 
deb http://download.webmin.com/download/repository sarge contrib

Save the file and exit the editor. If you used nano, do so by pressing CTRL+X, Y, then ENTER.

保存文件并退出编辑器。 如果您使用过nano ,请按CTRL+XY ,然后按ENTER

Next, you’ll add the Webmin PGP key so that your system will trust the new repository. In order to do that, though, you must install the gnupg1 package, which is GNU’s tool for secure communication and data storage.

接下来,您将添加Webmin PGP密钥,以便您的系统信任新的存储库。 但是,为了做到这一点,您必须安装gnupg1软件包,这是GNU用于安全通信和数据存储的工具。

Update your server’s package index if you’ve not done so recently:

如果您最近没有更新服务器的软件包索引,请执行以下操作:

  • sudo apt update

    sudo apt更新

Following that, download the Webmin PGP key with wget and add it to your system’s list of keys:

然后,使用wget下载Webmin PGP密钥并将其添加到系统的密钥列表中:

  • wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add

    wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt键添加

Next, update the list of packages again in order to include the now-trusted Webmin repository:

接下来,再次更新软件包列表,以包括现在受信任的Webmin存储库:

  • sudo apt update

    sudo apt更新

Then install Webmin:

然后安装Webmin:

  • sudo apt install webmin

    sudo apt安装webmin

Once the installation finishes, you’ll be presented with the following output:

安装完成后,将显示以下输出:


   
   
Output
. . . Webmin install complete. You can now login to https://your_server:10000 as root with your root password, or as any user who can use sudo.

Note: If you installed and enabled ufw during the prerequisite step, you will need to run the following command in order to allow Webmin through the firewall:

注意:如果在先决条件步骤中安装并启用了ufw ,则需要运行以下命令,以允许Webmin通过防火墙:

  • sudo ufw allow 10000

    须藤ufw允许10000

For extra security, you may want to configure your firewall to only allow access to this port from certain IP ranges.

为了提高安全性,您可能希望将防火墙配置为仅允许从某些IP范围访问此端口。

Let’s secure access to Webmin by adding a valid certificate.

让我们通过添加有效证书来保护对Webmin的访问。

第2步-使用“加密”添加有效证书 (Step 2 — Adding a Valid Certificate with Let’s Encrypt)

Webmin is already configured to use HTTPS, but it uses a self-signed, untrusted certificate. Let’s replace it with a valid certificate from Let’s Encrypt.

Webmin已经被配置为使用HTTPS,但是它使用了自签名,不受信任的证书。 让我们用“加密”中的有效证书替换它。

Navigate to https://your_domain:10000 in your web browser, replacing your_domain with the domain name pointing to your server’s IP address.

在您的Web浏览器中导航到https:// your_domain :10000 ,将your_domain替换为指向服务器IP地址的域名。

Note: When logging in for the first time, you will see an “Invalid SSL” warning. This warning may say something different depending on your browser, but the reason for it is that the server has generated a self-signed certificate. Allow the exception and proceed to your domain so you can replace the self-signed certificate with one from Let’s Encrypt.

注意:首次登录时,您将看到“无效的SSL”警告。 该警告可能会因您的浏览器而有所不同,但这是因为服务器已生成自签名证书。 允许例外并进入您的域,以便您可以用Let's Encrypt中的一个替换自签名证书。

You’ll be presented with a login screen. Sign in with the non-root user you created while fulfilling the prerequisites for this tutorial.

您将看到一个登录屏幕。 在满足本教程的先决条件的同时,使用您创建的非root用户登录。

Once you log in, the first screen you will see is the Webmin dashboard. Before you can apply a valid certificate, you have to set the server’s hostname. Look for the System hostname field and click on the link to the right, as shown in the following figure:

登录后,您将看到的第一个屏幕是Webmin仪表板。 必须先设置服务器的主机名,然后才能应用有效的证书。 查找“ 系统主机名”字段,然后单击右侧的链接,如下图所示:

This will take you to the Hostname and DNS Client page. Locate the Hostname field, and enter your Fully-Qualified Domain Name into the field. Then click the Save button at the bottom of the page to apply the setting.

这将带您进入主机名和DNS客户端页面。 找到“ 主机名”字段,然后在该字段中输入您的“完全限定域名”。 然后单击页面底部的“ 保存”按钮以应用设置。

After you’ve set your hostname, click on the Webmin dropdown menu in the left-hand navigation bar, and then click on Webmin Configuration.

设置主机名后,单击左侧导航栏中的Webmin下拉菜单,然后单击Webmin Configuration

From the Webmin Configuration page, select SSL Encryption from the list of icons, and then click on the Let’s Encrypt tab. You’ll see a screen like the following figure:

在“ Webmin配置”页面上,从图标列表中选择“ SSL加密 ”,然后单击“加密”选项卡。 您将看到如下图所示的屏幕:

On this page, you’ll tell Webmin how to obtain and renew your certificate. Let’s Encrypt certificates expire after 3 months, but you can instruct Webmin to automatically attempt to renew the Let’s Encrypt certificate every month. Let’s Encrypt looks for a verification file on the server, so we’ll configure Webmin to place the verification file inside the folder /var/www/your_domain, which is the folder that the Apache web server you configured in the prerequisites uses. Follow these steps to set up your certificate:

在此页面上,您将告诉Webmin如何获取和更新证书。 “让我们加密”证书在3个月后到期,但是您可以指示Webmin每月自动尝试续订“让我们加密”证书。 让我们加密在服务器上查找验证文件,以便我们将Webmin配置为将验证文件放置在/var/www/ your_domain文件夹中,该文件夹是您在先决条件中配置的Apache Web服务器使用的文件夹。 请按照以下步骤设置证书:

  1. Fill in Hostnames for certificate with your FQDN.

    用您的FQDN填写证书的主机名

  2. For Website root directory for validation file, select the Other Directory button and enter your website’s document root. Assuming you followed the prerequisite Apache tutorial this will be /var/www/your_domain.

    对于用于验证文件的网站根目录 ,选择其他目录按钮,然后输入网站的文档根目录。 假设您遵循了必备的Apache教程,则教程将为/var/www/ your_domain

  3. For Months between automatic renewal section, deselect the Only renew manually option by typing 1 into the input box, and select the radio button to the left of the input box.

    对于自动更新之间的月份部分,通过在输入框中键入1取消选择“ 仅手动更新”选项,然后选择输入框左侧的单选按钮。

Click the Request Certificate button. After a few seconds, you will see a confirmation screen.

单击请求证书按钮。 几秒钟后,您将看到一个确认屏幕。

To use the new certificate, click the Return to Webmin configuration button on the confirmation screen. From that page, scroll down and click the Restart Webmin button. Wait around 30 seconds, and then reload the page and log in again. Your browser should now indicate that the certificate is valid.

要使用新证书,请在确认屏幕上单击“ 返回Webmin配置”按钮。 在该页面上,向下滚动并单击Restart Webmin按钮。 等待大约30秒钟,然后重新加载页面并再次登录。 您的浏览器现在应该指示证书有效。

步骤3 –使用Webmin (Step 3 – Using Webmin)

You’ve now set up a secured working instance of Webmin. Let’s look at how to use it.

现在,您已经设置了Webmin的安全工作实例。 让我们看看如何使用它。

Webmin has many different modules that can control everything from the BIND DNS Server to adding users to the system. Let’s look at how to create a new user, and then explore how to update your system’s packages using Webmin.

Webmin有许多不同的模块,可以控制从BIND DNS服务器到将用户添加到系统中的所有内容。 让我们看看如何创建一个新用户,然后探索如何使用Webmin更新系统的软件包。

管理用户和组 (Managing Users and Groups)

Let’s explore how to manage the users and groups on your server.

让我们探讨如何管理服务器上的用户和组。

First, click the System dropdown menu in the left-hand sidebar, and then click the link for Users and Groups. From here, you can add and manage users and groups.

首先,点击左侧边栏中的系统下拉菜单,然后点击用户和组的链接。 在这里,您可以添加和管理用户和组。

Let’s create a new user called deploy which you can use to host web applications. When creating a user, you can set options for password expiry, the user’s shell, and whether or not they are allowed a home directory.

让我们创建一个名为deploy的新用户,您可以使用它来托管Web应用程序。 创建用户时,可以设置密码到期时间,用户的外壳程序以及是否允许使用主目录的选项。

To add a user, click Create a new user, which is located at the top of the users table. This displays the Create User screen, where you can supply the username, password, groups and other options. Follow these instructions to create the user:

要添加用户,请点击位于用户表顶部的创建新用户 。 这将显示“ 创建用户”屏幕,您可以在其中提供用户名,密码,组和其他选项。 请按照以下说明创建用户:

  1. Fill in Username with deploy.

    deploy填写用户名

  2. Select Automatic for User ID.

    用户ID选择自动

  3. Fill in Real Name with a descriptive name like Deployment user.

    使用描述性名称(如Deployment user填写实名

  4. For Home Directory, select Automatic.

    对于主目录 ,选择自动

  5. For Shell, select /bin/bash from the dropdown list.

    对于Shell ,从下拉列表中选择/ bin / bash

  6. For Password, select Normal Password and type in a password of your choice.

    对于“ 密码” ,选择“ 普通密码”,然后输入您选择的密码。

  7. Jump down to Primary Group and select New group with same name as user.

    跳至主要组,然后选择与用户同名的新组

  8. For Secondary Group, select sudo from the All groups list. This should automatically be added to the In groups list, but if it isn’t press the -> button to add it.

    对于Secondary Group ,从All groups列表中选择sudo 。 这应该自动添加到“ 分组”列表中,但是如果没有,请按->按钮添加它。

After making those selections, press Create. This will create the deploy user in short order.

做出选择之后,按创建 。 这将在短时间内创建部署用户。

Next, let’s look at how to install updates to our system.

接下来,让我们看看如何将更新安装到我们的系统。

更新包 (Updating Packages)

Webmin lets you update all of your packages through its user interface. To update all of your packages, first, click the Dashboard button above the left-hand sidebar, and then locate the Package updates field. If there are updates available, you’ll see a link that states the number of available updates.

Webmin允许您通过其用户界面更新所有软件包。 要更新所有软件包,请首先单击左侧边栏上方的仪表板按钮,然后找到“ 软件包更新”字段。 如果有可用更新,您将看到一个链接,其中列出了可用更新的数量。

Click this link, and then press Update selected packages to start the update. You may be asked to reboot the server, which you can also do through the Webmin interface.

单击此链接,然后按“ 更新选定的程序包”以开始更新。 可能会要求您重新引导服务器,这也可以通过Webmin界面进行。

结论 (Conclusion)

You now have a secured working instance of Webmin and you’ve used the interface to create a user and update packages. Webmin gives you access to many things you’d normally need to access through the console, and it organizes them in an intuitive way. For example, if you have Apache installed, you would find the configuration tab for it under Servers, and then Apache.

现在,您具有Webmin的安全工作实例,并且已使用该界面创建用户和更新程序包。 Webmin使您可以访问通常需要通过控制台访问的许多内容,并且以直观的方式组织它们。 例如,如果安装了Apache,则可以在Servers下找到Apache的配置选项卡,然后在Apache下找到它。

Explore the interface, or read the Official Webmin wiki to learn more about managing your system with Webmin.

浏览界面,或阅读Webmin官方Wiki,以了解有关使用Webmin管理系统的更多信息。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-20-04

webmin 安装

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值