Score:0

Safe guest account in RAM (please review)

kh flag

The Issue:

Sometimes you need to inspect the contents of USB devices from family or friends, but you don't know whether it is really a safe device, even though it most likely is safe.
You want to do that with minimal effort while protecting yourself from common attack vectors.

Method:

Have a safer guest user that its home directory returns to its original state per request.

Implementation:

  1. Create a new user via GUI.
    It is a standard (non-admin) user.
    Let's call this user guest.

  2. By default, disable the user with:
    usermod --expiredate 1 guest

  3. Copy the contents of ~/guest to a directory in a persistent storage.
    Let's call this directory /path/to/perst/guesthome.

  4. Empty all the contents of directory ~/guest.

  5. Create a script file init_guest.sh which performs the following:

  • Empty all the contents of the directory ~/guest.

  • Mounts a tmpfs filesystem to ~/guest.

  • Copies (rsync, maintain permissions) the contents of directory:
    /path/to/perst/guesthome
    to directory:
    ~/guest

  • Enable the user only for today with:
    usermod --expiredate $( date "+%Y-%m-%d" )

Advantages:

  • Somewhat protection against popular attacks like badUSB (simulated keyboard) or risky executables. (The guest environment is refreshed so no persistent changes to user's init files.) So it is relatively safer for inspecting contents of foreign and untrusted USB devices.
  • Personal users' files are protected due to basic linux permissions.
  • Minimal impact on persistent storage (reduced wearout).
  • Ability to easily change the initial environment for the guest.

Is it considered a relatively safe approach or did I overlook an issue?

user535733 avatar
cn flag
Your family and friends should keep their filthy, malware-laden USB sticks to themselves. If you REALLY want to inspect a dirty USB stick or have a safe Guest account, then disconnect your HDD/SSD and simply use a LiveUSB's "Try Ubuntu" environment for the purpose.
David avatar
kh flag
@user535733 Then how would I setup a LiveUSB's "Try Ubuntu" if I can't plug in a USB device? Thank you.
user535733 avatar
cn flag
I don't see "*can't plug in a USB device*" as one of the constraints listed in your Question above, nor in my comment. That would be silly, of course, as it would make the entire question meaningless.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.