/dev fix for Xen / Debootstrap'd Debian

I have installed a few Debian Sarge (and 4.0) systems in the last week while building a web app for a customer, and they all came up with some (IMO) bad permissions in /dev/. In particular /dev/urandom, /dev/random, /dev/null and /dev/tty were being vexatious by persisting in being unwriteable for common users. This meant I got a few funky errors when trying to SSH as a Regular Guy, or use SSH, or do other 'normal' type things.

This is no bother if you run your Xen guests logged in as root all the time, but that kind of thing just doesn't feel right to me. So I wrote a very basic init.d script to fix this ...

Here's how to install this script:

  1. First, take a glance at the script and ensure I'm not A Bad Guy.
  2. Download the script and install it to /etc/init.d/local-devperms
    wget -O /etc/init.d/local-devperms http://giantrobot.co.nz/gr/wp-content/uploads/2006/11/local-devperms.txt
  3. Do chmod +x /etc/init.d/local-devperms
  4. Install the script using update-rc.d:
    update-rc.d local-devperms defaults 5

Comments

Also, don't forget to

Also, don't forget to install udev - that will help if you get no ttys

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <code> <br> <h2> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.