This is what I have written down to myself after trying what was then called Raspbian out a while ago:

  1. Go to: https://www.raspberrypi.org/downloads/raspberry-pi-os/
  2. Download the "Lite" ZIP file.
  3. Run Etcher ( https://www.balena.io/etcher/ ) and "burn" the "image" inside onto the flash card.
  4. Create the empty file "ssh" in the root dir for it to run the SSH server and thus enable me to access it.
  5. Put the flash card into the RPI and plug in to the network and power cables.
  6. As quickly as possible, before any bad actor can scan for my RPI and take it over, log in via SSH with the username "pi" and password "raspberry".
  7. Immediately change the password with passwd into something like this: f7oBELrqB8Xs7jO9sAgzH7TE6LCjgD6ccdCtHQNSQk2AsIsg2rc0IQga8
  8. The machine is supposedly installed.

But there is one important step missing: the one where it encrypts the whole thing, so that nobody can just locally steal my data (without extraordinary measures), and a password must be entered on boot with a temporarily attached USB keyboard.

I find nothing on this, to me, crucial and integral step. Applying encryption after installation appears to be a nightmare of separate commands, which I need to avoid at any cost. Please tell me that there is a "file trick" like with the "ssh" empty file in step 4, but for encryption? Maybe I can create a text file called "encrypt" and it simply contains the password which will be used and required? Please tell me that this is a thing.

I cannot use my RPI without encryption. It doesn't matter if it's much slower. I cannot order any extra hardware or enter a long list of manual commands. Please tell me that there is a simple step like above, or that a single command can now be run after the "installation" (if you can call it "installation" when the whole thing is apparently ready when the flash card goes into the RPI) to encrypt the system? If this is not possible, or so cumbersome as to not be done in practice, my entire plan for my RPI and myself is ruined.

Please don't link me to a tutorial with many steps and ads. I've already seen those. I'm looking for an elegant, supported, built-in solution.

I frankly can't understand who would ever want to run an unencrypted machine of any kind, no matter what it's used for. This seems like such a basic security measure to me that it feels irresponsible to everyone it would affect to not have this done.

  • 3
    Raspberry pi was created as an educational device - if you're running "mission critical" and/or "highly classified" data on it, you've picked the wrong toy - as for I frankly can't understand who would ever want to run an unencrypted machine of any kind - that sounds like paranoia (as does point 6). The fact is, and you know this, you can do what you want, it just takes effort on your part Commented Aug 11, 2020 at 10:52
  • I think this is a duplicate of raspberrypi.stackexchange.com/questions/10076/… which describes some ways of doing full-disk encryption for Raspberry Pi. Commented Aug 11, 2020 at 12:17
  • 1
    #6 is a bit daft. Either a malicious party is already waiting, in which case you cannot possibly act fast enough, or they are not, in which case it doesn't matter how leisurely you are at that point. I mention this because WRT security is easy to become distracted by and waste resources chasing the wrong thing. Similarly WRT encryption, it makes more sense to encrypt the root fs/partition rather than the entire device. Look into LUKS, I believe it is in reasonably widespread use on the Rpi.
    – goldilocks
    Commented Aug 11, 2020 at 14:53

1 Answer 1


As far as I understand you want to have an encrypted storage for the complete operating system that can only be started if you enter a password to boot it. Please note that this only protects against physical access to an unpowered computer. As long as the computer is running it must decrypt the storage to be able to run, so it doesn't help when an intruder crack the access to the running system. The protection is given by avoiding physical access to the device and to ensure strong remote access control. It is given by ssh with proper configuration. This is the reason why most secured systems focus on remote access and have the local storage locked in a secure room but don't take much effort to encrypt it. An experienced intruder with physical access to a computer with encrypted storage will just have attention that he doesn't power it down before he has cracked it.

The decryption must begin before the boot loader access the storage and it must take place all the time on the fly. This is a very low level task that must be done before the boot loader is running or the boot loader must do it by itself. You also have to initialize the storage for it. That's the reason why you do not find just a simple command to switch on encryption of an operating system storage.

You may consider to use only an encrypted directory to store the data. This reduces low level configuration because you will find special file systems for this supported by the operating system. But it is also not done with one command.

If you are not comfortable with usual protection (avoid physical access, focus on secure remote access), I'm afraid your entire plan is ruined.

  • 1
    Excellent analysis - could be titled, "Why Some Security Systems Are a Poor Investment"
    – Seamus
    Commented Aug 11, 2020 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.