Can I disable the drives in debian?

If none of the more specific forums is the right place to ask

Can I disable the drives in debian?

Postby Digifracture » 2020-01-03 12:06

Hello there.

I have a bit of a weird question.
I want to have a live usb or an external ssd for debian (or ubuntu if it's easier to do what I want).
The thing is that when I boot the linux on my pc I want the rest of the drives on my machine to be disabled or hidden.
Mostly want to use it for late night research purposes (nothing malicious before anyone says something) and I don't really want the rest of the machine exposed.

So first of all, is what I'm thinking going to work? I know that malicious software most of the time doesnt know that it is in a vmware for example (but i don't really wanna bother with vmware) so it wont know that there are other drives on the system right?
If it can be done and I'm not just pulling stuff out of my ass I will do some extra research to find how to do it.

I'm not really experienced with debian, only basic stuff and it's been a few years since I worked on anything unixy.
Thank you in advance.
Last edited by Digifracture on 2020-01-03 12:32, edited 1 time in total.
Digifracture
 
Posts: 4
Joined: 2020-01-03 11:54

Re: Few questions.

Postby Head_on_a_Stick » 2020-01-03 12:25

Digifracture wrote:malicious software most of the time doesnt know that it is in a vmware

Detecting virtualisation is a trivial matter:
Code: Select all
empty@E485:~ $ systemd-detect-virt                                                       
none
1|empty@E485:~ $

A chroot should do what you want but make backups before experimenting.

EDIT: systemd-nspawn will allow you to drop capabilities before entering the chroot.

EDIT2: please change the thread title to something more descriptive so that this thread will show up in search engines, it would also help attract the attention of those who know about this subject.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12511
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Few questions.

Postby Digifracture » 2020-01-03 12:37

Head_on_a_Stick wrote:
Digifracture wrote:malicious software most of the time doesnt know that it is in a vmware

Detecting virtualisation is a trivial matter:
Code: Select all
empty@E485:~ $ systemd-detect-virt                                                       
none
1|empty@E485:~ $

A chroot should do what you want but make backups before experimenting.

EDIT: systemd-nspawn will allow you to drop capabilities before entering the chroot.

EDIT2: please change the thread title to something more descriptive so that this thread will show up in search engines, it would also help attract the attention of those who know about this subject.


You are right with the title, changed it so it won't be so vague.

From what I've checked with the commands you posted is that they are mostly for virtualization.
I don't want to make a vm, used it as an example.

I want to install debian or ubuntu (as I remember there aren't really many differences between them) on an external ssd.
But when I boot from that ssd I want the rest of my drives (that I use in windows) to be hidden/disabled while in linux.
My idea is that IF there is a possibility of something infecting linux(external ssd) it wont spread to my other drives.
Digifracture
 
Posts: 4
Joined: 2020-01-03 11:54

Re: Few questions.

Postby Head_on_a_Stick » 2020-01-03 12:43

Digifracture wrote:From what I've checked with the commands you posted is that they are mostly for virtualization.

No, a chroot != virtualisation.

Digifracture wrote:I want to install debian or ubuntu (as I remember there aren't really many differences between them) on an external ssd.
But when I boot from that ssd I want the rest of my drives (that I use in windows) to be hidden/disabled while in linux.

If you enter a chroot environment in the system on the external SSD then you won't be able to "see" the drives that are attached.

EDIT: a basic chroot isn't secure though: https://access.redhat.com/blogs/766093/posts/1975883

So use systemd-nspawn and drop as many capabilities as you can before entering the chroot. It's still not brilliant though.

EDIT2: or use a standard chroot with capsh(1).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12511
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Can I disable the drives in debian?

Postby CwF » 2020-01-03 14:26

If it is a point to hide from user or display you can hide disk or partitions.
Create the file /etc/udev/rules.d/99-hide-partition.rules with the following content:
Code: Select all
ENV{ID_SERIAL}=="ST31000528AS_123456", ENV{UDISKS_IGNORE}="1"
CwF
 
Posts: 774
Joined: 2018-06-20 15:16

Re: Few questions.

Postby Digifracture » 2020-01-03 16:03

Head_on_a_Stick wrote:
Digifracture wrote:From what I've checked with the commands you posted is that they are mostly for virtualization.

No, a chroot != virtualisation.

Digifracture wrote:I want to install debian or ubuntu (as I remember there aren't really many differences between them) on an external ssd.
But when I boot from that ssd I want the rest of my drives (that I use in windows) to be hidden/disabled while in linux.

If you enter a chroot environment in the system on the external SSD then you won't be able to "see" the drives that are attached.

EDIT: a basic chroot isn't secure though: https://access.redhat.com/blogs/766093/posts/1975883

So use systemd-nspawn and drop as many capabilities as you can before entering the chroot. It's still not brilliant though.

EDIT2: or use a standard chroot with capsh(1).


My bad then must have read the wrong thing when I searched for the command.
I will try it later today. Thank you for the help bud.
Digifracture
 
Posts: 4
Joined: 2020-01-03 11:54

Re: Can I disable the drives in debian?

Postby Bulkley » 2020-01-03 16:42

Digifracture, are you talking about going on the Internet invisibly? If so, consider Tails.

Tails is a live system that aims to preserve your privacy and anonymity. It helps you to use the Internet anonymously and circumvent censorship almost anywhere you go and on any computer but leaving no trace unless you ask it to explicitly.


Tails in designed to fit on a removable drive. Tails erases memory when shutting down. If I lived in one of the world's hot spots I'd use Tails as my primary OS.

Edited to add: When I take risks with my machine I unplug my primary drive.
Bulkley
 
Posts: 5995
Joined: 2006-02-11 18:35

Re: Can I disable the drives in debian?

Postby Digifracture » 2020-01-04 16:56

Bulkley wrote:Digifracture, are you talking about going on the Internet invisibly? If so, consider Tails.

Tails is a live system that aims to preserve your privacy and anonymity. It helps you to use the Internet anonymously and circumvent censorship almost anywhere you go and on any computer but leaving no trace unless you ask it to explicitly.


Tails in designed to fit on a removable drive. Tails erases memory when shutting down. If I lived in one of the world's hot spots I'd use Tails as my primary OS.

Edited to add: When I take risks with my machine I unplug my primary drive.


Nope, I was actually talking about pron.
I mostly use hub for my personal exploration but you never know what horrors lie within.

I'm talking about having an external ssd to boot linux and in that boot I want to disable the other drives on my pc so in the chance of getting something malicious on my system it wont spread further.

Thanks for this though will look into it.
Digifracture
 
Posts: 4
Joined: 2020-01-03 11:54


Return to General Questions

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable