Overslaan naar inhoud
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Aanmelden
  • Nederlands English (US) Español (AR)
  • Contact
  • Startpagina
  • Blog
  • Vacatures
  • Contact
Cafayate.Net
  • 0
  • 0
    • Startpagina
    • Blog
    • Vacatures
    • Contact
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Aanmelden
  • Contact

Using LXD remote with ssh port forward

  • Alle blogs
  • Tech Blog
  • Using LXD remote with ssh port forward
  • 5 maart 2021 in
    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…

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

    Ontworpen voor bedrijven

    We zijn een team van gepassioneerde mensen met als doel levens te verbeteren met vernieuwende producten. We ontwikkelen geweldige oplossingen voor al je zakelijke uitdagingen. Onze producten zijn ontworpen voor kleine tot middelgrote bedrijven die hun prestaties willen optimaliseren.

    Neem contact op

    Plantexel
    Pedernera
    Salta Capital 
    Argentina

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