One place for hosting & domains

      Webmin

      Cómo instalar Webmin en Ubuntu 18.04


      El autor seleccionó el Tech Education Fund para que recibiese una donación de $100 como parte del programa Write for DOnations.

      Introducción

      Webmin es un panel de control basado en la Web para cualquier máquina con Linux que le permite administrar su servidor a través de una interfaz moderna basada en la Web. Con Webmin, puede cambiar los ajustes para paquetes comunes sobre la marcha, incluidos los servidores web y las bases de datos, así como administrar usuarios, grupos y paquetes de software.

      A través de este tutorial, instalará y configurará Webmin en su servidor, y garantizará el acceso a la interfaz con un certificado válido usando Let´s Encrypt y Apache. Luego, usará Webmin para añadir nuevas cuentas de usuario y actualizar todos los paquetes en su servidor desde el panel.

      Requisitos previos

      Para completar este tutorial, necesitará lo siguiente:

      Paso 1: Instalación de Webmin

      En primer lugar, debemos añadir el repositorio Webmin para poder instalar y actualizar Webmin fácilmente usando nuestro administrador de paquetes. Esto se hace agregando el repositorio al archivo /etc/apt/sources/.list.

      Abra el archivo en su editor:

      • sudo nano /etc/apt/sources.list

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

      /etc/apt/sources.list

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

      Guarde el archivo y cierre el editor.

      A continuación, agregue la clave PGP de Webmin para que su sistema confíe en el nuevo repositorio:

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

      Luego, actualice la lista de paquetes para que incluya el repositorio Webmin:

      A continuación, instale Webmin:

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

      Output

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

      Ahora, garantizaremos el acceso a Webmin disponiéndolo detrás del servidor web Apache y añadiendo un certificado TLS/SSL válido.

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

      Para acceder a Webmin, debe especificar el puerto 10000 y comprobar que esté abierto en su firewall. Esto resulta inconveniente, en especial si accede a Webmin usando un FQDN como webmin.your_domain. Usaremos un host virtual Apache para solicitudes de proxy enviadas al servidor Webmin que funciona en el puerto 10000. 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:

      • sudo nano /etc/apache2/sites-available/your_domain.conf

      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

      
      <VirtualHost *:80>
              ServerAdmin your_email
              ServerName your_domain
              ProxyPass / http://localhost:10000/
              ProxyPassReverse / http://localhost:10000/
      </VirtualHost>
      
      

      Esta configuración indica a Apache que apruebe solicitudes enviadas a http://localhost:10000, 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 /etc/webmin/miniserv.conf en su editor:

      • sudo nano /etc/webmin/miniserv.conf

      Encuentre la siguiente línea:

      /etc/webmin/miniserv.conf

      ...
      ssl=1
      ...
      

      Cambie el 1 por un 0. 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 /etc/webmin/config en su editor:

      • sudo nano /etc/webmin/config

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

      /etc/webmin/config

       . . . 
      referers=your_domain
      

      Guarde el archivo y cierre el editor.

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

      • sudo systemctl restart webmin

      Luego, habilite el módulo proxy_http de Apache:

      Verá el siguiente resultado:

      Output

      Considering dependency proxy for proxy_http: Enabling module proxy. Enabling module proxy_http. To activate the new configuration, you need to run: systemctl restart apache2

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

      • sudo a2ensite your_domain

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

      Output

      Enabling site your_domain. To activate the new configuration, you need to run: systemctl reload apache2

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

      • sudo systemctl restart apache2

      Nota: Asegúrese de permitir el tráfico entrante en su servidor web los puertos 80 y 443 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 sudo ufw allow en "Apache Full".

      Diríjase a http://your_domain 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:

      • sudo certbot --apache --email your_email -d your_domain --agree-tos --redirect --noninteractive

      Verá el siguiente resultado:

      Output

      Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Obtaining a new certificate Performing the following challenges: http-01 challenge for your_domain Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/your_domain-le-ssl.conf Enabled Apache socache_shmcb module Enabled Apache ssl module Deploying Certificate to VirtualHost /etc/apache2/sites-available/your_domain-le-ssl.conf Enabling available site: /etc/apache2/sites-available/your_domain-le-ssl.conf Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/your_domain.conf to ssl vhost in /etc/apache2/sites-available/your_domain-le-ssl.conf ------------------------------------------------------------------------------- Congratulations! You have successfully enabled https://your_domain You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=your_domain -------------------------------------------------------------------------------

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

      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 http://your_domain 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 Nombre de usuario con implementar.
      2. Seleccione Automático para el campo ID de usuario.
      3. Complete el campo Nombre verdadero con un nombre descriptivo, como usuario de implementación.
      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:

      Webmin muestra el número de actualizaciones de paquetes disponibles

      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.

      Conclusión

      Ahora contará con una instancia de trabajo segura de Webmin, y ha usado la interfaz para crear un usuario y actualizar paquetes. Webmin le brinda acceso a muchas cosas a las que normalmente tendría que acceder a través de la consola y las organiza de forma intuitiva. Por ejemplo, si tiene Apache instalado, encontraría la pestaña de configuración en Servidores y Apache.

      Para obtener más información sobre la administración de su sistema con Webmin, explore más la interfaz o consulte el sitio wiki oficial de Webmin.



      Source link

      How To Install Webmin on Debian 10


      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.

      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.

      Prerequisites

      To complete this tutorial, you will need:

      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.

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

      • sudo nano /etc/apt/sources.list

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

      /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.

      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.

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

      Then install gnupg1:

      Following that, download the Webmin PGP key with wget:

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

      Then add the package key:

      • sudo apt-key add jcameron-key.asc

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

      Then install 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:

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

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

      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.

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

      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.

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

      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:

      Image showing where the link is on the Webmin dashboard

      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.

      After you've set your hostname, click on the Webmin dropdown menu in the left-hand navigation bar, and then click on 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:

      Image showing the Let's Encrypt tab of the SSL Encryption section

      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:

      1. Fill in Hostnames for certificate with your 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.
      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.

      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.

      Step 3 – Using Webmin

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

      Webmin has many different modules that can control everything from the BIND DNS Server to something as simple as 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.

      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.

      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.
      2. Select Automatic for User ID.
      3. Fill in Real Name with a descriptive name like Deployment user.
      4. For Home Directory, select Automatic.
      5. For Shell, select /bin/bash from the dropdown list.
      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.

      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.

      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.

      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.

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



      Source link

      How To Install Webmin on Debian 9


      Introduction

      Webmin is a modern web control panel for any Linux machine that allows you to administer your server through a simple interface. With Webmin, you can change settings for common packages on the fly.

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

      Prerequisites

      To complete this tutorial, you will need:

      Step 1 — Installing Webmin

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

      Open the file in your editor:

      • sudo nano /etc/apt/sources.list

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

      /etc/apt/sources.list

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

      Save the file and exit the editor.

      Next, add the Webmin PGP key so that your system will trust the new repository:

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

      Next, update the list of packages to include the Webmin repository:

      Then install Webmin:

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

      Output

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

      Please copy down this information, as you will need it for the next step.

      Note: If you installed ufw during the prerequisite step, you will need to run the command sudo ufw allow 10000 in order to allow Webmin through the firewall. For extra security, you may want to configure your firewall to only allow access to this port from certain IP ranges.

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

      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.

      Navigate to https://your_domain:10000 in your web browser, replacing your_domain with the domain name you pointed at your server.

      Note: When logging in for the first time, you will see an "Invalid SSL" error. This is because the server has generated a self-signed certificate. Allow the exception to continue so you can replace the self-signed certificate with one from 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.

      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:

      Image showing where the link is on the Webmin dashboard

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

      After you've set your hostname, click on Webmin on the left navigation bar, and then click on Webmin Configuration.

      Then, select SSL Encryption from the list of icons, and then select the Let's Encrypt tab. You'll see a screen like the following figure:

      Image showing the Let's Encrypt tab of the SSL Encryption section

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

      1. Fill in Hostnames for certificate with your FQDN.
      2. For Website root directory for validation file, select the Other Directory button and enter /var/www/html.
      3. For Months between automatic renewal section, deselect the Only renew manually option by typing 1 into the input box, and selecting the radio button to the left of the input box.
      4. Click the Request Certificate button. After a few seconds, you will see a confirmation screen.

      To use the new certificate, restart Webmin by clicking the back arrow in your browser, and clicking 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.

      Step 3 – Using Webmin

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

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

      Managing Users and Groups

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

      First, click the System tab, and then click the Users and Groups button. Then, from here, you can either add a user, manage a user, or add or manage a group.

      Let's create a new user called deploy which can be used for hosting web applications. 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.
      2. Select Automatic for User ID.
      3. Fill in Real Name with a descriptive name like Deployment user.
      4. For Home Directory, select Automatic.
      5. For Shell, select /bin/bash from the dropdown list.
      6. For Password, select Normal Password and type in a password of your choice.
      7. For Primary Group, select New group with same name as user.
      8. For Secondary Group, select sudo from the All groups list, and press the -> button to add the group to the in groups list.
      9. Press Create to create this new user.

      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.

      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, go to the Dashboard link, and then locate the Package updates field. If there are updates available, you'll see a link that states the number of available updates, as shown in the following figure:

      Webmin shows the number of updates available

      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.

      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.

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



      Source link