Home » Linux OS and Software » How-To » Incorrect device permissions after restart
Thu, 07 February 2013 10:39 Go to next message
z0th  is currently offline z0th
Registered: May 2010
Messages: 8
I'm not sure if this is due to the udev update, or some other issue. But may of my devices in /dev did not get the proper permissions set on them (should be 0666). The symptoms were lots of these errors upon login:

-bash: /dev/null: Permission denied


And when trying to start a screen session:

"No more PTYs" 
"Sorry, could not find a PTY"


I checked my udev rules in /lib/udev/rules.d/50-* and they do seem to be intact.

$ egrep "null|pt" /lib/udev/rules.d/50-*  
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="ptmx",                 GROUP="tty", MODE="0666"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="null|zero|full|random|urandom", MODE="0666"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="irlpt[0-9]*",          GROUP="lp"
/lib/udev/rules.d/50-udev-default.rules:KERNEL=="pt[0-9]*|npt[0-9]*|pht[0-9]*", GROUP="tape"


So I suspect its not udev that is causing the problem.

FWIW, here is the script I dropped into my /etc/local.d/ (equiv to rc.local on other distros) directory to ensure that the permissions are set correctly.

#!/bin/bash
# fix for incorrect permissions on devices in /dev
devices="ptmx null zero full random urandom"
for device in $devices; do 
        chmod 0666 /dev/${device}
done
exit 0


Apparently the /dev/tty* devices may also have this problem, but I have not ensountered any problems so far. Because the rules are intact and apparently assigning the correct permissions, I'm not convinced that udev is the problem, yet.
Fri, 08 February 2013 10:07 Go to previous messageGo to next message
z0th  is currently offline z0th
Registered: May 2010
Messages: 8
Can an admin move this out of HOWTO? Not sure why I posted it here....

Still getting some strange errors when trying to ssh FROM my VPS.

This morning when trying to ssh to a couple of hosts, I received this error.

PRNG is not seeded


I fixed this by chmod'ing /dev/urandom to 0666 (I forgot to do this yesterday). That fixed the PRNG problem, but now im seeing errors like the below when trying to ssh or scp.

$ scp rotate_fsdump.sh HOST_DELETED:/home/USER_DELETED
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive).
lost connection
$ ssh home 
Received disconnect from 69.xxx.xxx.106: 2: Too many authentication failures for USER_DELETED


I checked the logs on one of the hosts I was attempting to ssh TO. Here is what I found (names and IPs changed)

Feb  8 10:02:44 hostname sshd[7683]: SSH: Server;Ltype: Version;Remote: 66.xxx.xxx.46-45802;Protocol: 2.0;Client: OpenSSH_5.9p1-hpn13v11
Feb  8 10:02:44 hostname sshd[7683]: SSH: Server;Ltype: Kex;Remote: 66.xxx.xxx.46-45802;Enc: aes128-ctr;MAC: hmac-md5;Comp: none [preauth]
Feb  8 10:02:44 hostname sshd[7683]: SSH: Server;Ltype: Authname;Remote: 66.xxx.xxx.46-45802;Name: USER_DELETED [preauth]
Feb  8 10:02:45 hostname sshd[7685]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=66.xxx.xxx.46  user=USER_DELETED
Feb  8 10:02:47 hostname sshd[7683]: error: PAM: Authentication failure for USER_DELETED from 66.xxx.xxx.46
Feb  8 10:02:47 hostname sshd[7683]: Postponed keyboard-interactive for USER_DELETED from 66.xxx.xxx.46 port 45802 ssh2 [preauth]
Feb  8 10:02:47 hostname sshd[7686]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=66.xxx.xxx.46  user=USER_DELETED
Feb  8 10:02:49 hostname sshd[7683]: error: PAM: Authentication failure for USER_DELETED from 66.xxx.xxx.46
Feb  8 10:02:49 hostname sshd[7683]: Failed keyboard-interactive/pam for USER_DELETED from 66.xxx.xxx.46 port 45802 ssh2
Feb  8 10:02:49 hostname sshd[7683]: Postponed keyboard-interactive for USER_DELETED from 66.xxx.xxx.46 port 45802 ssh2 [preauth]
Feb  8 10:02:49 hostname sshd[7687]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=66.xxx.xxx.46  user=USER_DELETED
Feb  8 10:02:51 hostname sshd[7683]: error: PAM: Authentication failure for USER_DELETED from 66.xxx.xxx.46
Feb  8 10:02:51 hostname sshd[7683]: Failed keyboard-interactive/pam for USER_DELETED from 66.xxx.xxx.46 port 45802 ssh2
Feb  8 10:02:51 hostname sshd[7683]: Disconnecting: Too many authentication failures for USER_DELETED [preauth]


There was no attempt made at authentication. Not quite sure whats causing this particular problem yet. Anyone experienced anything like this?
Wed, 20 February 2013 17:07 Go to previous message
z0th  is currently offline z0th
Registered: May 2010
Messages: 8
Guess not.

I found another perms problem with /dev/tty as well. Updated my little startup script appropriately.

#!/bin/bash
# fix for incorrect permissions on devices in /dev
devices="tty ptmx null zero full random urandom"
for device in $devices; do
        chmod 0666 /dev/${device}
done
exit 0


Previous Topic:SMTP mail server?
Next Topic:Vps Issues
Goto Forum:
  


Current Time: Fri Aug 18 12:23:18 EDT 2017
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2006 FUD Forum Bulletin Board Software