On Wed, Sep 08, 2021 at 11:24:18AM +0200, jim hook wrote: > test$ cd > rmplayer > test$ > test$ type cd > cd is a function > test$ > test$ tail -4 .profile > cd() > { > echo rmplayer > } > test$ > test$ uname -mrs > OpenBSD 6.9 amd64 > test$ > > Thinking of that home dirs could be on a shared storage, that can be accessed > by others and maliciously modify the ".profile", etc. files of the targeted > user. > > ex.: "unset cd" would help, but any solution in general?
If your $HOME is on a shared drive that can be written by others, then blocking people from redefining shell builtins would be like throwing deck chairs off the Titanic, i.e., you have no security whatsoever. The only general solution is to have your home directory under better control.