r/linuxquestions • u/BMW-E60-535i • 8d ago
How to isolate my usb linux system
I have a debian based system and i want to isolate the system in a way it doesnt have a chance to interact with my main ssd
Now i have 2 scary solutions either to air gap my ssd which is pain in the ass and doing so daily could break something and second solution is to block tge pci from bios now i dont have the settings to do so i found an open source solution but it may brick my device 2 risky approaches
8
Upvotes
5
u/Drate_Otin 8d ago
More information required:
3
u/serverhorror 8d ago
The only way to achieve that with guarantees is to nit have the SSD attached to the device.
Just buy a second cheap device or find a way to make the removal easier.
3
u/realddgamer 8d ago
Yeah like others said, either unplug it or if you just want to prevent reads then have it encrypted.
Though this seems silly anyways. If your goal is security then don't do anything that would compromise your security on debian
2
u/CardOk755 8d ago
Is your "main SSD" encrypted? If not, why not?
If it was your "USB Linux" system couldn't read your "main SSD".
If you're worried about your "USB Linux" writing to your "main SSD" then run it in a VM.
1
u/victormas208 8d ago
It's a very new concept for me; besides security, what's the advantage? Stability or a requirement for a project?
1
u/meijad 8d ago
If the debian system is on an SSD and not a NVMe and in a desktop computer, you could do something like a sata power selector (Hard disk control system) to keep the drive unpowered when in the other OS/drive. Or wire together your own togglable disconnect. Or just reach in and disconnect the drive when not used.
1
u/BCMM 8d ago
You could remove the
nvmeand/orahcikernel modules from your live environment, so the kernel won't know how to talk to SSDs. Make sure they're gone from the main filesystem and from the initramfs.You'll need to manually do this again every time you upgrade the kernel, or find a way to automate it.
Important note: if you're just trying to protect against your own honest mistakes, this might be useful. If this is supposed to be protection against potentially malicious software that you intend to test, this is a bad idea (and your whole approach is also a bad idea).
1
u/chuggerguy Linux Mint 22.3 Zena | MATÉ 8d ago
I have a total of five internal devices that I was able to hide when booting to my USB mirror. Normally booting a USB mirror automounts all five devices just like I was booting to my internal device.
The image was taken while booted to the USB for a one time test. Notice that no other devices appear either in the disks app or lsblk.
I have no reason to do that but maybe that's what you're after?
Myself, I'd probably just not allow them to automount if I were worried but that's just me.
Disclaimer, although I have hidden devices by a single UUID before, I used Gemini to expand it to hide ALL internal devices.
Have fun.
1
u/ThellraAK 8d ago
What's the goal?
If it's write protecting the drive, add the windows drive to your fstab, and mount it read only somewhere only root can you touch it.
2
u/inbetween-genders 8d ago
Do the pain the the ass one 👍
1
u/levelZeroWizard 8d ago
By turning it into a vm disk and running it with whatever vm manager. You can pass through whatever hardware you need
My question is what on earth problem do you have that requires any of this? Are you fighting ultron or something?
1
u/mredding 7d ago
The best way to do this is to disable the whole SATA controller via boot parameters. Get the device ID for your SATA controller with
lspci -nn | grep -i sata. Then, append to the end ofGRUB_CMDLINE_LINUX_DEFAULTin/etc/default/grub:Update GRUB:
sudo update-grub.If you want to use the SATA controller and you just want to unbind this one device, then first find the device ID with
lsblk -o NAME,SERIAL. Create a file/etc/systemd/system/unbind-sata.service, and put this in it:Then run the commands:
Either way, reboot and verify.
The result should be the same, your USB Linux environment will come up and ignore either the SATA controller or the specific drive. You cannot do better without either disabling the device in the BIOS, or physically removing it from the machine.
And the other thing to know is this is us using the OS, opting-in to ignoring the device. You can always load the device after booting, we didn't lock ourselves out entirely; so this is only good for preventing accidental access, it's not security from a determined user.