This was a problem i faced and found that /dev/null is is not a charector devide. This is causing failure for all messages which are directed to /dev/null.
$ cat ash > /dev/null
/dev/null: Permission denied.
$ ls -l /dev/null
-rw-r--r-- 1 root root 0 Aug 9 11:22 /dev/null
Solution:
The problem seems to be with the permissions of the /dev/null. This seems to be read only at the moment for you. Check this by logging in as root and listing it with the command:
ls -l /dev/null
You should see this if everything is correctly set:
crw-rw-rw- 1 root root 1, 3
If you get a different set of permissions like this maybe:
-rw-r--r-- 1 root root 1, 3
then you should (as root) delete the /dev/null with:
rm /dev/null
and recreate it (as root) again with:
mknod -m 0666 /dev/null c 1 3
(The device number according to the Kernel source in the documentation under Documentation/devices.txt supposed to be Major=1 und Minor=3)
Now, list the /dev/null again and you should see the permissions as above. Hope this helps & it worked for me..
$ cat ash > /dev/null
/dev/null: Permission denied.
$ ls -l /dev/null
-rw-r--r-- 1 root root 0 Aug 9 11:22 /dev/null
Solution:
The problem seems to be with the permissions of the /dev/null. This seems to be read only at the moment for you. Check this by logging in as root and listing it with the command:
ls -l /dev/null
You should see this if everything is correctly set:
crw-rw-rw- 1 root root 1, 3
If you get a different set of permissions like this maybe:
-rw-r--r-- 1 root root 1, 3
then you should (as root) delete the /dev/null with:
rm /dev/null
and recreate it (as root) again with:
mknod -m 0666 /dev/null c 1 3
(The device number according to the Kernel source in the documentation under Documentation/devices.txt supposed to be Major=1 und Minor=3)
Now, list the /dev/null again and you should see the permissions as above. Hope this helps & it worked for me..
chmod 666 /dev/null should work, no need to remove and recreate.
ReplyDeleteThanks for your post, would try that ..
ReplyDeleteThanks a lot it worked for me ....
ReplyDeleteMan, you saved me, thank you!
ReplyDeleteI wasn't able to connect via sftp connection and there was nothing talking about my problem.
I've noticed this error when I was connecting to my server via ssh connection and I thought of searching for this problem, and when I applied your solution, voila... I can now connect via stfp connection :)
I know what caused this problem, I was searching in the internet for a way to know my server's internet connection speed, and I tried the following command:
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
Of course don't try this one :)
Good to know that this helped you mate.
ReplyDeleteCheers.
Hi,
ReplyDeleteI am also facing the same issue with /dev/null and provided solution is working for me too.
But how can we fix this issue.
Thanks.
this helped me and i was able to continue with my work :) thanks a lot for sharing :)
ReplyDeleteIs there any reason why this occurs?
ReplyDeleteThank you Ash, this helped me too. Now trying to figure out why the permissions on /dev/null were changed.
ReplyDeleteBest,
Pedro
Glad it helped mate.. cheers..
DeleteThanks, man! Really, this is awesome! =D
ReplyDeleteGlad it helped ..
DeleteThanks very much, useful.
ReplyDeleteGlad it helped..
DeleteI have permissions as crw-rw-rw- 1 root root ,3 and logged in as root
ReplyDeletestill it shows as permission denied
@Justin L. Franks..
ReplyDeletechmod 666 /dev/null should work, no need to remove and recreate.
This is working fine... Thanks for you help
I set a config option in my.cnf (mysql) to log-errors to /dev/null and this seemed to cause the folder to be recreated by mysql (had mysql owner and group). Removed the offending option, restarted mysqld service. Removed and recreated as noted in original post and the errors vanished. Thank you.
ReplyDeleteGlad to know it helped..
DeleteI think you need to restart the server after you recreate the file
ReplyDeletenot required for me
Delete