Hacker News new | past | comments | ask | show | jobs | submit login

Plug: I made a small set of shell scripts to achieve something similar to this a couple of years ago, but with symlinks:

https://tomwh.uk/blog/posts/2020/03/28/fake-home-prison/

https://tomwh.uk/git/fake-home.git/

It's a simple command that shadows the binary names you want with a wrapper in ~/.local/bin/ that calls the original binary after redefining $HOME to be somewhere else (by default inside ~/.local/share/fake-home/).

So if you have a program foo that dumps stuff in ~/.foo, then running `fakehome-banish foo` will create a symlink "foo" inside ~/.local/bin/evil-software (which is added to $PATH) that points to "fakehome".

"fakehome" is a simple wrapper script that, busybox-style, gets the binary name that it's being called as ("foo"), and then sets $HOME to be ~/.local/share/fakehome and calls the original foo binary.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: