go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/connection/fs/README.md (about)

     1  # Virtual Filesystem
     2  
     3  This transport reads a directory and treats it as its own platform. This is useful if you want to do a static analysis of a mounted operating system, where you wan to ensure nothing is running.
     4  
     5  ## Testing
     6  
     7  If you need to test a remote Linux system on macOS, it is possible to spin up the machine and mount the whole filesystem to your local machine.
     8  
     9  ```bash
    10  # NOTE: make sure you do NOT run the following as sudo
    11  
    12  # create local mount directory
    13  mkdir -p ~/mnt/minikube
    14  sshfs -o allow_other,default_permissions root@192.168.99.103:/  ~/mnt/minikube
    15  
    16  cat ~/mnt/minikube/etc/os-release 
    17  NAME=Buildroot
    18  VERSION=2020.02.10
    19  ID=buildroot
    20  VERSION_ID=2020.02.10
    21  PRETTY_NAME="Buildroot 2020.02.10"
    22  ```
    23  
    24  References
    25  
    26  * https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
    27  * https://osxfuse.github.io/
    28  * https://github.com/osxfuse/sshfs/releases
    29  
    30  ### local Linux & Vagrant
    31  
    32  On debian, the needed package is called `sshfs`.
    33  
    34  When you want to connect to a Vagrant VM, you need to add an ssh key to the root user.
    35  
    36  Then you can use root, to mount via sshfs:
    37  
    38  ```bash
    39  sshfs -o default_permissions root@127.0.0.1:/ ./mnt -o IdentityFile=/home/you/.ssh/id_rsa -o Port=2222
    40  ```