Как избежать случайного корневого доступа к non-world-readable каталогам?

Существует файл, который сделает это: /etc/login.defs. Два значения Вы хотите надеяться изменяться здесь:

  • PASS_MAX_DAYS
  • PASS_MIN_DAYS
0
задан 1 September 2011 в 17:02
2 ответа

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....

export PS1="\u@\h [\$(check_path.sh)]>

Where check_path.sh is something like...

#!/bin/bash

if [ `whoami` = 'root' -a `pwd` = '/home/joe'] ; then
   echo -n "!!!!!!accessing /home/joe as root !!!!!!!!!"
fi
3
ответ дан 4 December 2019 в 12:51

You could write a script inside .bashrc

something like ... if [ command == "cd /home/joe" ] do ask done

0
ответ дан 4 December 2019 в 12:51

Теги

Похожие вопросы