Prevent Linux from adding a file to the memory cache?

Hope you all saw the wonderful site, Linux Ate My Ram. This is usually great, but for me it's a problem. I have a protected file that I decrypt with gpg, and then read into memory for processing. An unencrypted file is deleted after a while, but I DO NOT want this decrypted file to be stored in the Linux cache file in memory.

Is there a way to explicitly prevent saving a file from the Linux cache?

Thank!

+3
source share
3 answers

Use gpg -dthat will cause the GPG to output the file to STDOUT, so that you can have all of this in memory.

, , mlock.

+9

gpg, ramfs. .

ramfs , ( root):

mount none /your/mnt/point -t ramfs

, tmpfs. , . , tmpfs .

+2

. .

shred -u $FILE

, , . , , .: -)

0

Source: https://habr.com/ru/post/1792326/


All Articles