LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   -bash: /dev/null: Permission denied and growing size (https://www.linuxquestions.org/questions/linux-newbie-8/bash-dev-null-permission-denied-and-growing-size-813604/)

karlochacon 06-11-2010 01:50 PM

-bash: /dev/null: Permission denied and growing size
 
hi guys

I gotta a Centos 5.0 that suddenly every time I log in I get this
Code:

-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
-bash: /dev/null: Permission denied
.....

I check the system and
Code:

ls -lh /dev/null
-rw-r--r-- 1 root root 7.8M Jun 11 12:51 /dev/null

and If check a system running OK the permissions and file type are different

Code:

ls -lh /dev/null
crw-rw-rw- 1 root root 1, 3 May  9 00:57 /dev/null

1. what could be the reason that caused this null file change the permissions and file type?
also notice the last modification time is equal to my date and the file is 7MB????

2. How can I get it back to its original file type? for permissions would be chmod 644 but for file type? or Can I copy the file from another server working fine?

thanks a lot

AlucardZero 06-11-2010 01:59 PM

Somebody deleted / moved / overwrote /dev/null. Do (from man null):
Code:

rm /dev/null && mknod -m 666 /dev/null c 1 3 && chown root:root /dev/null

karlochacon 06-11-2010 02:16 PM

thanks a lot

you are the man

karlochacon 06-11-2010 02:28 PM

.....


All times are GMT -5. The time now is 07:25 AM.