Given the following directory:
drwx------ 2 joe joe 4096 Jan 11 2010 /home/joe
Is there a way for me as the user root, to avoid accidentally cd-ing into this directory?
I'm not looking for actual permission enforcement, but for some setting (e.g. in the bash shell) that helps the root user avoid such a "private" directory.
There's no way of preventing root from accessing the directory - within a Unix system root is omnipotent.
As to accidentally doing it.....it depends on what you are using to access the directory.
You might try....
Where check_path.sh is something like...
You could write a script inside .bashrc
something like ... if [ command == "cd /home/joe" ] do ask done