The PAM pam_console.so module manages console file
permissions and authentication. (See the Official Red Hat Linux Reference Guide
for more information on configuring PAM.) If you want to disable all
console access, including program and file access, comment out all lines
that refer to pam_console.so in the
/etc/pam.d directory. As root, the following
script will do the trick:
cd /etc/pam.d
for i in * ; do
sed '/[^#].*pam_console.so/s/^/#/' < $i > foo && mv foo $i
done |