You are not logged in.

#1 2012-06-06 13:54:01

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

[SOLVED]-bash: /dev/null: Permission denied

Hi,
After update and reboot I now got -bash: /dev/null: Permission denied each time I log in... /dev/null is after reboot set to 600, I can chmod it to 666, but how can I make it persist?

Any help will be appreciated (^_^)

Thanks a lot

Last edited by p4l4cl][n (2012-06-06 14:57:07)

Offline

#2 2012-06-06 14:07:05

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED]-bash: /dev/null: Permission denied

Can you still login as root?

Check which shell is configured for your specific user (grep <youruser> /etc/passwd). If this is set to /dev/null for whatever reason, you can use "chsh" to change it (to /bin/bash for example).


Burninate!

Offline

#3 2012-06-06 14:09:18

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: [SOLVED]-bash: /dev/null: Permission denied

Oh, I propably did not say it right (I am not a native speaker...)... I CAN login as regular user, I CAN sudo chmod 666 /dev/null... But it does not persist next time I reboot..

PS: we are talking about VPS, so root login is not allowed (in sshd)

Last edited by p4l4cl][n (2012-06-06 14:10:02)

Offline

#4 2012-06-06 14:49:15

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED]-bash: /dev/null: Permission denied

It should be set in a udev rule:

$ grep null /lib/udev/rules.d/*
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="null|zero|full|random|urandom", MODE="0666"

Your rules.d dir is probably different (different distro).

Offline

#5 2012-06-06 14:55:14

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: [SOLVED]-bash: /dev/null: Permission denied

brebs: thanks a lot smile /etc/udev/rules.d/ was empty, after I created file according to your post and rebooted, averythings seems ok now smile Thanks a lot again

Offline

#6 2012-06-06 17:34:14

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]-bash: /dev/null: Permission denied

This isn't really a fix... /dev is devtmpfs these days which means its mostly kernel managed. /dev/null is created as mode 0666, and shouldn't be touched by udev. It would be better to find out what's causing the permissions to change than to blindly override it.

Offline

#7 2012-06-06 17:43:11

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: [SOLVED]-bash: /dev/null: Permission denied

I agree... but that's beyond my capabilities hmm

Offline

#8 2012-06-08 22:57:26

Mister_Magotchi
Member
Registered: 2012-06-08
Posts: 13

Re: [SOLVED]-bash: /dev/null: Permission denied

I'm having the same issue as the OP, but as falconindy said, the fix used isn't really proper.

I'm using a VPS (OpenVZ), and the same happened to me after updating today (many parts of /dev lost the proper permissions, including null, zero, full, random, and urandom).  I also don't have any files in /etc/udev/rules.d (although /usr/lib/udev/rules.d has a bunch of stuff).

Could someone please help point me in the right direction on finding the culprit for the change in permissions?

Also, the problem exists on two different VPS, but on a physical server I also run, the permissions are correct.

Last edited by Mister_Magotchi (2012-06-08 22:59:44)

Offline

#9 2012-06-08 23:01:18

p4l4cl][n
Member
Registered: 2011-11-16
Posts: 43

Re: [SOLVED]-bash: /dev/null: Permission denied

I am on openvz too...

Offline

#10 2012-06-29 09:36:17

Lucky
Member
From: /dev/random
Registered: 2009-08-07
Posts: 28

Re: [SOLVED]-bash: /dev/null: Permission denied

I talkt with falconindy, because i got the same problem so there is the fix (workaround). I know falconindy don't like override permission by udev, but maybe OpenVZ Container need this. If i had time, maybe i will look deeper in it.

Problem was upgrade from udev v182-4 to systemd-tools v184-2, because of removing the following line.

cat /etc/udev/rules.d/50-fix-permission.rules

# Thomas Lucke (Lucky) archlinux@builds.lucky.li
#
# In a OpenVZ container with enabled udev (systemd-tools), you run in some
# permission problems, because the udev rule was removed by this commit:
# http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=378f2e074e38490103f999173bf717a5394170f8

# mem
SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"

btw. please post there if you get problems, because i don't follow the forum.
https://aur.archlinux.org/packages.php?ID=57949

Offline

#11 2012-07-03 05:41:00

rwd
Member
Registered: 2009-02-08
Posts: 658

Re: [SOLVED]-bash: /dev/null: Permission denied

<removed>

Last edited by rwd (2012-07-03 05:41:41)

Offline

#12 2020-11-04 08:36:14

eEQK
Member
Registered: 2020-11-04
Posts: 1

Re: [SOLVED]-bash: /dev/null: Permission denied

I had the same problem that is issues with permissions of /dev/null
additionally, after I've fixed them, no terminal would start in X session
it was because I've created myself a new rule that was supposed to fix my adb permissions:

/etc/udev/rules.d/99-adb.rules
ATTRS{idVendor}=="2717", ATTRS{idProduct}=="4e42", ENV{ID_GPHOTO2}="1",
  ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1",
  MODE="0664", GROUP="plugdev"

now that I've removed this rule, everything (except for adb xD) works fine

Offline

#13 2020-11-04 08:51:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 11,168

Re: [SOLVED]-bash: /dev/null: Permission denied

You cannot and should not split udev rules on new lines, every new line is considered a new rule

Closing this 8 year old thread.

Offline

Board footer

Powered by FluxBB