Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preventing Linux from adding file into memory cache?

I hope you've all seen the wonderful site, Linux Ate My Ram. This is usually great, but it presents a problem for me. I have a secure file that I'm decrypting with gpg and then reading into memory to process. The unencrypted file is deleted a short time later, but I do NOT want that decrypted file to be saved in Linux's in-memory file cache.

Is there a way to explicitly prevent a file from being saved from Linux's cache?

Thanks!

like image 647
daveslab Avatar asked Aug 23 '26 17:08

daveslab


1 Answers

Use gpg -d, which will cause GPG to output the file to STDOUT, so then you can have it all in memory.

Depending on how paranoid you are, you may want to use mlock as well.

like image 130
rmmh Avatar answered Aug 26 '26 06:08

rmmh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!