Ir al contenido
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Inicia sesión
  • Nederlands English (US) Español (AR)
  • Contáctanos
  • Inicio
  • Blog
  • Empleos
  • Contáctanos
Cafayate.Net
  • 0
  • 0
    • Inicio
    • Blog
    • Empleos
    • Contáctanos
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Inicia sesión
  • Contáctanos

Using LXD remote with ssh port forward

  • Todos los blogs
  • Tech Blog
  • Using LXD remote with ssh port forward
  • 5 de marzo de 2021 por
    Administrator

    This one came to me, while using LXD on a test server i have. LXD 2.0 stable is one of the great things that came with Ub untu 16.04LTS. I follow this project for a while and always waiting for the right time to be able to use it.

    I have been using this for 2 months and i have no complains, so far. It’s stable as the word says. The usual method is to ssh into my test server and there i use lxc to manage my containers.

    So i just do:

    # Create a SSH tunnel to your laptop
    ssh [email protected]
    
    # Use it
    lxc list
    lxc exec odoo1 bash
    (many other available lxc commands ...)
    

    Now i recalled that even no being on the same local network i can register the remote LXD daemon on the local interface 127.0.0.1 using a different port than the default 8443.

    For this to be possible, we just need to set it up on the LXD server first:

    lxc config set core.https_address "[127.0.0.1]:9443"
    lxc config set core.trust_password some-password
    

    Now, we need to add the remote on our laptop:

    # You need at least to have lxd-client tools
    sudo apt install lxd-client
    
    # Add the remote LXD server on our laptop
    lxc remote add test 127.0.0.1:9443
    
    # Create a SSH tunnel to your laptop
    ssh -NL 9443:localhost:9443 [email protected]
    
    # Try it out
    lxc list test:
    lxc exec test:odoo1 bash
    

    Now imagine how much easier is to use a lxc file pull/push running lxc on your local…

    en Tech Blog
    Nginx: Block URL Access (wp-admin/wp-login.php) To All Except One IP Address

    Diseñado para empresas

    Somos un equipo de personas apasionadas cuyo objetivo es mejorar la vida de todos a través de productos revolucionarios. Creamos grandes productos para resolver sus problemas empresariales. Nuestros productos están diseñados para pequeñas y medianas empresas dispuestas a optimizar su rendimiento.

    Contáctenos

    Plantexel
    Pedernera
    Salta Capital 
    Argenina

    • +31 653-919-302
    • [email protected]
    Síganos
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)