Установка и настройка удаленного доступа на centos 7 с помощью webmin

Step 4 — Configuring Webmin Using The Post-Installion Wizard

To configure Webmin, we’ll use its web-based Post-Installation Wizard. Open your web browser and navigate to . You can also use your fully-qualified domain name to access the site.

Note: Your browser may show a “Your connection is not secure” or “Your connection is not private” warning since Virtualmin uses a self-signed certificate. This warning is normal. You can add Let’s Encrypt SSL certificate after you have completed this tutorial by following Step 2 of the tutorial.

Log in as the root user with the newly-changed password you set in the previous step.

Once you have logged in, you’ll see the Introduction screen stating that you are going through the steps to configure Virtualmin. Press Next to continue.

On the Virus scanning screen, select No for Run ClamAV server scanner so you’ll use less RAM. Press Next to continue.

On the Spam filtering screen, select No for Run SpamAssassin server filter and press Next to continue.

The next three screens configure the database server:

  • On the Database servers screen, select Yes to Run MySQL database server and no to Run PostgreSQL database server. Press Next to continue.
  • On the MySQL password screen, enter your desired MySQL root password. It should be different from the root password you used to log in to Webmin.
  • On the MySQL database size screen, select the RAM option that matches the amount of RAM your server has. For a 1GB server, select Large system (1G) on which MySQL is heavily used. Press Next to continue.

Next, you’ll see a screen like the following, where you’re asked to enter nameservers:

Enter your primary and secondary nameservers here which you configured in the prerequisites. If you haven’t set these up, check the Skip check for resolvability box to avoid error message and proceed.

Next, on the Password storage mode screen, select Store plain-text passwords if you must support password recovery. Otherwise, choose Only store hashed passwords. After clicking Next, you will see the All done screen. Click Next to end.

Finally, you’ll be presented with the Virtualmin/Webmin dashboard.

You may see a message at the top stating that Virtualmin comes with a new theme. To activate the new theme, click the Switch Themes button. The page will reload but may look unstyled, as the new theme’s CSS file might not load properly. To solve this issue, refresh your browser manually.

You may also see a message stating that Virtualmin’s configuration has not been checked. Click the Re-check and refresh configuration button to check your Virtualmin configuration. Address any errors that the check reports.

Your server is now configured. Let’s use the interface to create a new virtual server.

Setting Up Reverse Proxy

If you install Webmin on a production server, you might want to set up reverse proxy with Apache or Nginx so that you can use a domain name to access the Webmin interface without specifying the port number (10000). This also allows you to obtain and install a valid Let’s Encrypt TLS certificate for Webmin.

If you don’t have a real domain name, I recommend going to NameCheap to buy one. The price is low and they give whois privacy protection free for life.

Disable HTTPS Mode in Webmin

Before setting up the reverse proxy, we need to disable HTTPS mode in Webmin, because later we are going to terminate TLS connection at Apache/Nginx. Edit the Webmin configuration file.

sudo nano /etc/webmin/miniserv.conf

Find the following line.

ssl=1

Change it to the following to disable HTTPS mode in Webmin.

ssl=0

Save and close the file. Then restart Webmin.

sudo systemctl restart webmin

Apache

If you prefer to use Apache web server, then follow the instructions below to set up reverse proxy.

Install Apache web server.

sudo apt install apache2

To use Apache as a reverse proxy, we need to enable the , and module.

sudo a2enmod proxy proxy_http rewrite

Then create a virtual host file for Webmin.

sudo nano /etc/apache2/sites-available/webmin.conf

Add the following texts into the file. Replace with your actual domain name and don’t forget to set an A record for it.

<VirtualHost *:80>
    ServerName webmin.your-domain.com

    ProxyPass / http://127.0.0.1:10000/
    ProxyPassReverse / http://127.0.0.1:10000/
</VirtualHost>

Save and close the file. Then enable this virtual host.

sudo a2ensite webmin.conf

Reload Apache for the changes to take effect.

sudo systemctl reload apache2

Now you can remotely access Webmin by entering the domain name ( ) in browser address bar.

Nginx

If you prefer to use Nginx web server, then follow the instructions below to set up reverse proxy.

Install Nginx on Ubuntu.

sudo apt install nginx

Start Nginx web server.

sudo systemctl start nginx

Then create a new server block file in directory.

sudo nano /etc/nginx/conf.d/webmin.conf

Paste the following text into the file. Replace with your preferred domain name and don’t forget to create A record for it. If you use a different port, change 8080 to your own port number.

server {
       listen 80;
       server_name webmin.your-domain.com;

       location / {
              proxy_pass http://127.0.0.1:10000;
              proxy_set_header Host $http_host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
        }
}

Save and close the file. Then test Nginx configuration.

sudo nginx -t

If the test is successful, reload Nginx.

sudo systemctl reload nginx

Now you can access Webmin Web interface via .

Pré-requisitos

Para completar este tutorial, você precisará de:

  • Um servidor Ubuntu 18.04 configurado seguindo o guia de configuração inicial do servidor Ubuntu 18.04, incluindo um usuário sudo não-root e um firewall.
  • O Apache instalado seguindo o Como Instalar Linux, Apache, MySQL, pilha PHP (LAMP) no Ubuntu 18.04. Vamos usar o Apache para executar a verificação de domínio do Let’s Encrypt e agir como um proxy para o Webmin. Certifique-se de configurar o acesso ao Apache através do seu firewall ao seguir este tutorial.
  • Um Nome de Domínio Completamente Qualificado (FQDN), com um registro DNS A apontando para o endereço IP do seu servidor. Para configurar isso, siga o tutorial Como Configurar um Nome de Host com o DigitalOcean.
  • O Certbot instalado seguindo o Passo 1 de Como Proteger o Apache com o Let’s Encrypt no Ubuntu 18.04. Você usará o Certbot para gerar o certificado TLS/SSL para o Webmin.

Step 1 — Setting the Hostname and FQDN

For Virtualmin to work properly, you need to configure the hostname and FQDN on the server itself by editing the and files, as well as update your DNS settings so DNS lookups resolve properly.

First, log in to your server as your non-root user. Once you have logged in, update the package database:

Then install any necessary updates and packages to ensure you start with a stable and up-to-date system.

Next, change the hostname to match the FQDN you’ve pointed to the server in the prerequisites.

To check the current server hostname, run this command:

To change the hostname for your server, open the file in your editor:

Delete the current hostname and replace it with your hostname:

/etc/hostname

Use just the hostname, not the entire FQDN, in this file. For example, if your FQDN is , enter in this file.

Save the file and exit the editor.

Next, add both the hostname and FQDN in the file:

Modify the line that starts with to use your FQDN and hostname, in that order:

/etc/hosts

Remember to replace and with your own hostname and domain name. Save the file and exit the editor.

If this line doesn’t exist in your file, add it to avoid some compatibility issues with other software on your Ubuntu system. You can learn more about this in the .

To check if the name has been changed correctly, reboot your server.

Then ssh into your server again. You should see the new hostname on your terminal prompt. For example:

Use the command to verify that the FQDN was set correctly:

You’ll see your FQDN in the output:

If you don’t, double-check the changes you made to your configuration, correct any errors, and reboot.

Next, edit the network configuration file so that it uses this server as one of the DNS servers to resolve domain names. Open the configuration file:

Add the IP address to the configuration file. Look for the following line:

/etc/network/interfaces.d/50-cloud-init.cfg

Change it to:

/etc/network/interfaces.d/50-cloud-init.cfg

Make sure there is a space before . Save the file and exit the editor.

You have prepared the server by setting the hostname, FQDN, and the network configuration. Let’s install Virtualmin.

Step 2 — Securing Webmin with Apache and Let’s Encrypt

To access Webmin, you have to specify port and ensure the port is open on your firewall. This is inconvenient, especially if you’re accessing Webmin using an FQDN like We are going to use an Apache virtual host to proxy requests to Webmin’s server running on port . We’ll then secure the virtual host using a TLS/SSL certificate from Let’s Encrypt.

First, create a new Apache virtual host file in Apache’s configuration directory:

/etc/apache2/sites-available/your_domain.conf

This configuration tells Apache to pass requests to , the Webmin server. It also ensures that internal links generated from Webmin will also pass through Apache.

Save the file and exit the editor.

Next, we need to tell Webmin to stop using TLS/SSL, as Apache will provide that for us going forward.

Open the file in your editor:

Find the following line:

/etc/webmin/miniserv.conf

Change the to a This will tell Webmin to stop using SSL.

Next we’ll add our domain to the list of allowed domains, so that Webmin understands that when we access the panel from our domain, it’s not something malicious, like a Cross-Site Scripting (XSS) attack.

Open the file in your editor:

Add the following line to the bottom of the file, replacing with your fully-qualified domain name.

/etc/webmin/config

Save the file and exit the editor.

Next, restart Webmin to apply the configuration changes:

Then enable Apache’s module:

You’ll see the following output:

The output suggests you restart Apache, but first, activate the new Apache virtual host you created:

You’ll see the following output indicating your site is enabled:

Now restart Apache completely to activate the module and the new virtual host:

Note: Ensure that you allow incoming traffic to your web server on port and port as shown in the prerequisite tutorial How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04. You can do this with the command .

Navigate to in your browser, and you will see the Webmin login page appear.

Warning: Do NOT log in to Webmin yet, as we haven’t enabled SSL. If you log in now, your credentials will be sent to the server in clear text.

Now let’s configure a certificate so that your connection is encrypted while using Webmin. In order to do this, we’re going to use Let’s Encrypt.

Tell Certbot to generate a TLS/SSL certificate for your domain and configure Apache to redirect traffic to the secure site:

You’ll see the following output:

The output indicates that the certificate was installed and Apache is configured to redirect requests from to .

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

Paso 1: Instalación de Webmin

Primero, deberemos añadir el repositorio Webmin de forma que podamos instalar y actualizar Webmin usando nuestro administrador de paquetes. Esto se hace agregando el repositorio al archivo

Abra el archivo en su editor preferido. En este caso, utilizaremos :

A continuación, agregue esta línea en la parte inferior del archivo para agregar el nuevo repositorio:

/etc/apt/sources.list

Guarde el archivo y salga del editor. Si utiliza , podrá hacerlo presionando , y luego .

A continuación, añadirá la clave PGP de Webmin para que su sistema confíe en el nuevo repositorio: Para hacer eso, primero debe instalar el paquete , que es la herramienta de GNU para proteger la comunicación y el almacenamiento de datos.

Actualice el índice de paquetes de su servidor si no lo ha hecho recientemente:

Tras eso, descargue la clave PGP de Webmin con y añádala a la lista de claves de su sistema:

A continuación, actualice la lista de paquetes de nuevo para incluir el repositorio Webmin que ahora es fiable:

A continuación, instale Webmin:

Cuando finalice la instalación, verá el siguiente resultado:

Nota: Si instaló y habilitó durante el paso de requisitos previos, deberá ejecutar el siguiente comando para permitir a Webmin a través del firewall:

Para mayor seguridad, es posible que desee configurar su firewall para que permita acceso únicamente a este puerto desde ciertos intervalos de IP.

Vamos a proteger su acceso a Webmin añadiendo un certificado válido.

Accessing Webmin Interface

Webmin runs on port 10000 by default. So you can access the Webmin web itnerface by going to:

http://localhost:10000

If your Webmin server is on your internal network, you can also access it through its network IP address (see example below):

http://192.168.0.20:10000

If you have port forwarding enabled on your router and you have a domain name referring to your server running Webmin, you may also access it through the internet using your domain name:

http://domain.com:10000

For now, should be enough. You will have to login using your system username and password.

Webmin Login

As soon as you login, you will be presented with the system information page that provides a summary of your server.

Webmin System Information Page

Paso 2: Protección de Webmin con Apache y Let´s Encrypt

Para acceder a Webmin, debe especificar el puerto y comprobar que esté abierto en su firewall. Esto resulta inconveniente, en especial si accede a Webmin usando un FQDN como Usaremos un host virtual Apache para solicitudes de proxy enviadas al servidor Webmin que funciona en el puerto . A continuación, protegeremos el host virtual usando un certificado TLS/SSL desde Let’s Encrypt.

Primero, cree un nuevo archivo de host virtual de Apache en el directorio de configuración de Apache:

Agregue lo siguiente al archivo, sustituyendo la dirección de correo electrónico y el dominio por el suyo:

/etc/apache2/sites-available/your_domain.conf

Esta configuración indica a Apache que apruebe solicitudes enviadas a , el servidor de Webmin. También garantiza que los enlaces internos generados desde Webmin pasen por Apache.

Guarde el archivo y cierre el editor.

A continuación, debemos indicar a Webmin que deje de usar TLS/SSL, ya que Apache nos lo proporcionará.

Abra el archivo en su editor:

Encuentre la siguiente línea:

/etc/webmin/miniserv.conf

Cambie el por un . Esto indicará a Webmin que deje de usar SSL.

A continuación, agregaremos nuestro dominio a la lista de dominios permitidos, de modo que Webmin interprete que cuando accedemos al panel desde nuestro dominio no se trata de una operación malintencionada, como un ataque de secuencias de comandos de sitios (XSS).

Abra el archivo en su editor:

Agregue la siguiente línea a la parte final del archivo, sustituyendo por su nombre de dominio completo.

/etc/webmin/config

Guarde el archivo y cierre el editor.

A continuación, reinicie Webmin para que se apliquen los cambios de configuración:

Luego, habilite el módulo de Apache:

Verá el siguiente resultado:

El resultado sugiere que reinicie Apache, pero primero debe activar el nuevo host virtual de Apache que creó:

Verá el siguiente resultado, que indicará que su sitio está habilitado:

Ahora, reinicie Apache completamente para activar el módulo y el nuevo host virtual:

Nota: Asegúrese de permitir el tráfico entrante en su servidor web los puertos y como se muestra en el tutorial de requisitos previos Cómo instalar una pila de Linux, Apache, MySQL y PHP (LAMP) en Ubuntu 18.04. Puede hacerlo con el comando .

Diríjase a en su navegador y verá la página de inicio de sesión de Webmin.

Advertencia: NO inicie sesión en Webmin aún; no hemos habilitado SSL. Si inicia sesión ahora, sus credenciales se enviarán al servidor en texto no cifrado.

Ahora, configuraremos un certificado para que su conexión esté cifrada mientras utiliza Webmin. Para hacerlo, utilizaremos Let’s Encrypt.

Indique a Certbot que genere un certificado TLS/SSL para su dominio y configure Apache para que redireccione el tráfico al sitio seguro:

Verá el siguiente resultado:

El resultado indica que el certificado se instaló y Apache está configurado para redireccionar solicitudes de a .

Con esto, habrá configurado una instancia de trabajo segura de Webmin. Veamos cómo usarlo.

Paso 3: Uso de Webmin

Webmin tiene módulos que pueden controlar todo, desde el servidor DNS de BIND hasta algo tan sencillo como la adición de usuarios al sistema. Veamos cómo crear un nuevo usuario y luego exploremos la forma de actualizar los paquetes de software usando Webmin.

Para iniciar sesión en Webmin, diríjase a e ingrese con el usuario *root *o un usuario con privilegios sudo.

Gestión de usuarios y grupos

Ahora, administraremos los usuarios y los grupos en el servidor.

Primero, haga clic en la pestaña Sistema y luego en el botón Usuarios y Grupos. Desde aquí puede añadir un usuario, administrarlo o añadir o administrar un grupo.

Crearemos un nuevo usuario llamado implementar que podría utilizarse para alojar aplicaciones web. Para agregar un usuario, haga clic en Crear un nuevo usuario, opción situada en la parte superior de la tabla de usuarios. Con esto se muestra la pantalla Crear usuario, en la que puede proporcionar el nombre de usuario, la contraseña, los grupos y otras opciones. Siga estas instrucciones para crear el usuario:

  1. Complete el campo con implementar.
  2. Seleccione Automático para el campo ID de usuario.
  3. Complete el campo Nombre verdadero con un nombre descriptivo, como .
  4. Para el campo Directorio de inicio, seleccione Automático.
  5. Para Shell, seleccione */bin/bash *en la lista desplegable.
  6. Para Contraseña, seleccione Contraseña normal y escriba la que elija.
  7. Para Grupo primario, seleccione Nuevo grupo con el mismo nombre que el de usuario.
  8. Para Grupo secundario, seleccione sudo en la lista Todos los grupos y presione el botón -> para agregar el grupo a la lista de en grupos.
  9. Seleccione Crear para crear este nuevo usuario.

Cuando cree un usuario, puede configurar opciones para el vencimiento de la contraseña, el shell del usuario o el hecho de que se le otorgue un directorio de inicio.

A continuación, veamos cómo instalar actualizaciones en nuestro sistema.

Actualización de paquetes

Webmin le permite actualizar todos sus paquetes a través de su interfaz de usuario. Para actualizar todos sus paquetes, haga clic en el enlace Panel y luego localice el campo Actualizaciones de paquetes. Si hay actualizaciones disponibles, verá un enlace que indicará el número de actualizaciones disponibles, como se muestra en la siguiente figura:

Haga clic en este enlace y luego presione *Actualizar los paquetes seleccionados *para iniciar la actualización. Es posible que se le solicite reiniciar el servidor, acción que también puede realizar a través de la interfaz de Webmin.

5. Uninstall Webmin on Debian 9

If for any reason you don’t find Webmin suitable for your needs, you can easily uninstall the Webmin package. To uninstall Webmin, you can use the following command:

apt-get --purge remove webmin

This will stop the service and will remove the Webmin files from your server. It will also remove the Webmin configurations so make sure you don’t have anything important before proceeding with the uninstallation.

Of course, you don’t have to install Webmin on Debian 9, if you use one of our Webmin Hosting Solutions, in which case you can simply ask our expert Linux admins to install Webmin on Debian 9 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Webmin on Debian 9, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Шаг 2 — Защита Webmin с помощью Apache и Let’s Encrypt

Чтобы получить доступ к Webmin, вы должны указать порт и убедиться, что порт открыт в брандмауэре. Это неудобно, особенно если вы получаете доступ к Webmin с помощью FQDN, например . Мы будем использовать виртуальный хост Apache для прокси-запросов к серверу Webmin, использующему порт . Затем нам нужно будет защитить виртуальный хост, используя сертификат TLS/SSL от Let’s Encrypt.

Создайте файл нового виртуального хоста Apache в директории конфигурации Apache:

Добавьте в файл следующие данные, заменив адрес электронной почты и домен на ваши собственные:

/etc/apache2/sites-available/your_domain.conf

Эта конфигурация позволяет Apache передавать запросы по адресу , на сервер Webmin. Она также гарантирует, что внутренние ссылки, созданные с помощью Webmin, также будут обрабатываться через Apache.

Сохраните файл и выйдите из редактора.

Теперь нам нужно попросить Webmin прекратить использование TLS/SSL, поскольку Apache будет делать это за нас.

Откройте в своем редакторе файл :

Найдите следующую строку:

/etc/webmin/miniserv.conf

Измените на . Это сообщит Webmin, что нужно прекратить использование SSL.

Затем мы добавим наш домен в список разрешенных доменов, чтобы Webmin не рассматривал вход в панель с нашего домена как действия злоумышленника, например, атака с использованием межсайтовых сценариев.

Откройте в своем редакторе файл :

Добавьте внизу файла следующую строку, заменив на ваше полное доменное имя.

/etc/webmin/config

Сохраните файл и выйдите из редактора.

Затем перезапустите Webmin, чтобы применить изменения конфигурации:

Активируйте модуль Apache :

Вывод должен выглядеть так:

Вывод рекомендует перезапустить Apache, но сначала необходимо активировать новый виртуальный хост Apache, который вы создали:

Вы увидите следующий вывод, указывающий, что ваш сайт активирован:

Перезапустите Apache, чтобы активировать модуль и новый виртуальный хост:

Примечание. Убедитесь, что вы разрешили прием входящего трафика для вашего веб-сервера на через порт и порт , как описано в разделе предварительных условий руководства Установка стека Linux, Apache, MySQL, PHP (LAMP) в Ubuntu 18.04. Вы можете сделать это с помощью команды в Apache Full.

Перейдите по адресу в браузере, в результате чего вы должны увидеть страницу входа Webmin.

Предупреждение. НЕ нужно выполнять вход в Webmin, поскольку мы еще не активировали SSL. Если вы выполните вход сейчас, ваши учетные данные будут отправлены на сервер в виде простого текста.

Теперь нам нужно настроить сертификат, чтобы ваша подключение было зашифровано при использовании Webmin. Для этого мы будем использовать Let’s Encrypt.

Попросите Certbot создать сертификат TLS/SSL для вашего домена и настроить Apache для перенаправления трафика на защищенный сайт:

Вывод должен выглядеть следующим образом:

Данный вывод показывает, что сертификат был установлен, а Apache настроен для перенаправления запросов с на .

Вы установили защищенный рабочий экземпляр Webmin. Давайте узнаем, ка его использовать.

Virtualmin – Дополнение многократно усиливающее WebMin

Virtualmin является поставщиком услуг вебхостинга для систем распространения программного обеспечения Linux и Berkeley (BSD). Данное ПО предлагает пользователям гибкую панель управления веб-хостинга с интерфейсом командной строки, полным интерфейсом прикладного программирования (API), удобными для системного администратора настройками по умолчанию и функциями безопасности. Давайте рассмотрим Virtualmin и цены. Готовы начать? Посетите его сайт.

Виртуалмин Цены

Цены Virtualmin основаны на двух видах планов: бесплатная или универсальная общественная лицензия (GPL) и платные подписки, которые начинаются от 6 долларов в месяц на 10 доменов. Основные различия между планами включают в себя количество доменов и устанавливаемых приложений, а также доступ к дополнительным функциям, таким как расширенная поддержка, учетные записи посредников и анализ системных данных.

планы

GPL

$ 0 – В месяц

$ 0 – – В год

10 доменов

$ 6 – В месяц

$ 60 – В год

50 доменов

$ 9 – В месяц

$ 90 – В год

100 доменов

$ 12 – В месяц

$ 120 – В год

250 доменов

$ 15 – В месяц

$ 150 – В год

Хотите начать работу с VirtualMin? Начните от сюда! .

Virtualmin Особенности

Думаю Вам будет полезен список некоторых функций Virtualmin:

  • Регистрация доменного имени
  • Хостинг доменов и поддоменов
  • Системная аналитика данных
  • Проекты с открытым исходным кодом
  • Реселлерский вариант веб-хостинга
  • Бесплатный план дает мощь сравнимую с платными аналогами
  • И больше

Virtualmin часто задаваемые вопросы

Как Virtualmin обеспечивает безопасность данных?

Virtualmin предоставляет ряд инструментов, которые помогают пользователям обеспечивать безопасность своих систем и данных. Все их продукты предоставляются через стандартные системные репозитории (yum / dnf в CentOS / RHEL или apt в Debian / Ubuntu). Кроме того, Virtualmin обеспечивает двух факторную аутентификацию, вход в систему сертификатов, защиту от перебора паролей и многие другие функции безопасности.

Может ли Virtualmin помочь начинающим создавать вебсайты?

Помимо вебхостинга, Virtualmin предлагает встроенный редактор вебсайтов WYSIWYG, а также создатель страниц на основе шаблонов, расширенный файловый менеджер и редактор с подсветкой синтаксиса и многое другое, чтобы помочь пользователям создавать веб ресурсы профессионально для полностью функционирующих сайтов.

Schritt 1 — Installieren von Webmin

Zuerst müssen wir das Webmin-Repository hinzufügen, damit wir Webmin mithilfe unseres Paketmanagers installieren und aktualisieren können. Dazu fügen wir das Repository der Datei hinzu.

Öffnen Sie die Datei in Ihrem bevorzugten Editor. Wir verwenden hier :

Fügen Sie dann diese Zeile am Ende der Datei ein, um das neue Repository hinzuzufügen:

/etc/apt/sources.list

Speichern Sie die Datei und beenden Sie den Editor. Wenn Sie verwendet haben, drücken Sie hierzu , , und dann .

Als Nächstes fügen Sie den PGP-Schlüssel von Webmin hinzu, damit Ihr System dem neuen Repository vertraut. Hierzu müssen Sie das Paket installieren, das Tool von GNU für sichere Kommunikation und Datenspeicherung.

Aktualisieren Sie den Paketindex Ihres Servers, falls Sie das nicht vor Kurzem getan haben:

Laden Sie anschließend den PGP-Schlüssel von Webmin mit herunter und fügen Sie ihn der Liste der Schlüssel Ihres Systems hinzu:

Aktualisieren Sie als Nächstes erneut die Liste von Paketen, um das jetzt vertrauenswürdige Webmin-Repository mit einzubeziehen:

Installieren Sie nun Webmin:

Sobald die Installation abgeschlossen ist, wird Ihnen die folgende Ausgabe angezeigt:

Anmerkung: Wenn Sie im Schritt Voraussetzungen installiert und aktiviert haben, müssen Sie den folgenden Befehl ausführen, damit Webmin die Firewall passieren kann:

Für eine erhöhte Sicherheit sollten Sie Ihre Firewall so konfigurieren, dass der Zugriff auf diesen Port nur von bestimmten IP-Bereichen aus möglich ist.

Stellen wir den Zugriff auf Webmin sicher, indem wir ein gültiges Zertifikat hinzufügen.

Passo 2 — Protegendo o Webmin com o Apache e o Let’s Encrypt

Para acessar o Webmin, você precisa especificar a porta e garantir que a porta está aberta no seu firewall. Isso é inconveniente, especialmente se estiver acessando o Webmin utilizando um FQDN como o . Vamos usar um host virtual do Apache para pedidos de proxy no servidor do Webmin funcionando na porta . Então, vamos proteger o host virtual utilizando um certificado TLS/SSL do Let’s Encrypt.

Primeiramente, crie um novo arquivo de host virtual do Apache no diretório de configuração do Apache:

/etc/apache2/sites-available/your_domain.conf

Esta configuração diz ao Apache para passar os pedidos para , o servidor do Webmin. Ela também garante que os links internos gerados do Webmin também irão passar pelo Apache.

Salve o arquivo e saia do editor.

Em seguida, precisamos dizer ao Webmin para parar de usar o TLS/SSL, uma vez que o Apache irá fornecer isso para nós a partir de agora.

Abra o arquivo no seu editor:

Encontre a seguinte linha:

/etc/webmin/miniserv.conf

Altere o para . Isto irá dizer ao Webmin para parar de usar o SSL.

Em seguida, vamos adicionar nosso domínio à lista de domínios permitidos, para que o Webmin compreenda que quando acessarmos o painel do nosso domínio, não é algo malicioso, como um ataque Cross-Site Scripting (XSS).

Abra o arquivo no seu editor:

Adicione a seguinte linha ao final do arquivo, substituindo o pelo seu domínio totalmente qualificado.

/etc/webmin/config

Salve o arquivo e saia do editor.

Em seguida, reinicie o Webmin para aplicar as alterações de configuração:

Então, habilite o módulo do Apache:

Você verá o seguinte resultado:

O resultado sugere que você reinicie o Apache, mas primeiro, ative o novo host virtual do Apache que você criou:

Você verá o seguinte resultado indicando que seu site está ativo:

Agora, reinicie o Apache completamente para ativar o módulo e o novo host virtual:

Nota: Certifique-se de que você permite o tráfego de entrada para seu servidor Web na porta e na porta como mostrado no tutorial pré-requisito Como Instalar Linux, MySQL, pilha PHP (LAMP) no Ubuntu 18.04. Você pode fazer isso com o comando .

Navegue para no seu navegador, e você verá a página de login do Webmin aparecer.

Aviso: NÃO logue no Webmin ainda, pois ainda não habilitamos o SSL. Se você entrar agora, suas credenciais serão enviadas para o servidor em sem proteção.

Agora, vamos configurar um certificado para que sua conexão esteja criptografada enquanto usar o Webmin. Para fazer isso, vamos usar o Let’s Encrypt.

Diga ao Certbot para gerar um certificado TLS/SSL para seu domínio e configurar o Apache para redirecionar o tráfego para o site seguro:

Você verá o seguinte resultado:

O resultado indica que o certificado foi instalado e o Apache está configurado para redirecionar pedidos do para .

Agora, você configurou uma instância segura e funcional do Webmin. Vamos ver como usá-lo.

Enable SSL Access

As you may know SSL offers a secure connection and therefore any information transmitted from your browser to your server is encrypted, reducing the chances of someone sniffing the content (which may include even your username and password). Webmin allows access through SSL (or HTTPS). To enable it go to -> . Check «Yes» for «Enable SSL if available?» and «Yes» for «Redirect non-SSL requests to SSL mode?» as shown in the picture below.

Webmin SSL Access

After you save, you will only be able to access Webmin using only HTTPS. All HTTP connections will automatically be forwarded to HTTPS.

That is about it for a basic introduction to Webmin. Go ahead and install Webmin on Ubuntu and enjoy administering your system through a user-friendly web interface.

Webmin Installation on Ubuntu 18.04

Since the installation of Webmin is done through the Linux Command Line, we will use the Terminal application for this purpose. In order to open the Terminal, you can either use the Ctrl+Alt+T shortcut or open it through Ubuntu Dash.

The first thing to do is to add the Webmin repository to your sources list. There are two ways to do so:

Method 1: Add Webmin Ubuntu repository

Open the /etc/apt/sources.list file to manually add the repository link to the list. In order to open the sources.list file, run the following command as root in your Terminal:

$ sudo nano /etc/apt/sources.list

This will open the file in the Nano editor. Move to the end of the file and paste the following line in order to add the Webmin repository to the list:

deb http://download.webmin.com/download/repository sarge contrib

Save and exit the file by pressing Ctrl+X and then Y for confirmation.

The next step is to get the Webmin PGP key for the newly added repository. This way the system will trust this repository. Run the following command to do so:

$ wget http://www.webmin.com/jcameron-key.asc

Then add the key through the following command:

$ sudo apt-key add jcameron-key.asc

Method 2:

An alternative to the manual method described above is to add the key and repository through the following method:

Enter the following command in order to download and add the Webmin repository key:

$ wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add

Then use the following command in order to download the Webmin repository to the list of sources on your system:

$ sudo add-apt-repository "deb http://download.webmin.com/download/repository sarge contrib"

Installing Webmin on Ubuntu

Once the repository has been added and recognized, let us update the list of packages on our system through the following command:

$ sudo apt update

Finally, install the Webmin application through the following command:

$ sudo apt install webmin

Enter Y when prompted to continue installation.

When the installation is complete, look up for these lines at the end of the output.

This will give you information about how to access the Webmin console through your browser.

Step 3 — Configuring Webmin’s Root Password

Virtualmin is an add-on to Webmin, and by default, Webmin uses the system root user and password for the web interface login. If you log in to your server using an SSH key, you may not have the system root password, or may not feel comfortable using it to log in remotely through a browser. Let’s tell Webmin to use a different password for its web interface. This process won’t change the system root password; it’ll just tell Webmin to use the password you specify for the login.

To change Webmin’s root password, use the following command:

Replace with your preferred password.

Next, restart the Webmin service so the changes take effect.

Next, we will configure Webmin using the web front-end.

Step 5 — Creating A New Virtual Server

Virtualmin makes it easy to set up new virtual hosts, as well as users to manage those hosts.

Click on the Virtualmin tab on the left sidebar to display the Virtualmin sidebar menu. Next, click Create Virtual Server. You’ll see the following screen:

On the form that appears, enter the following:

  • For Domain name, enter the domain name you plan to use for the new virtual server.
  • For Description, enter an appropriate description of your server.
  • For Administration password, enter a password that you’ll use to manage this virtual server. It should be different from other passwords you’ll use.

Leave all the other options at their default values.

Click Create Server to create the new virtual server. The screen will display output as Virtualmin creates the various components for you.

You have just created a new virtual server using Virtualmin, as well as a user that can manage the server. The username will be displayed in the output, and the password will be the password you set. You can provide that username and password to another user so they can manage the virtual server through Virtualmin themselves.

To log out of Virtualmin, click the red exit arrow icon at the bottom of the left sidebar.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector