Nat says…

why you should make root’s shell prompt look very different from your own

Posted in computing, nuxified, programming by Nat on January 29th, 2008

EDIT: For those who are finding this because they want to know how to change the look of the shell prompt, it’s quite simple:

Edit your .bashrc file ( /home/yourname/.bashrc , or /root/.bashrc for the root user), and change the PS1 variable. For example mine is PS1=’[\u@\h \W]\$ ‘ .

The format for PS1 can be found in the bash manual page, in the PROMPTING section (open a terminal, and type man bash[enter]/PROMPTING[enter] ).

Now, back to the funny story about me being really stupid :)

I’m writing a report in LaTeX, with this little makefile here:


# (insert tabs where you would expect them, code tags don’t work as advertised)

all: report.pdf

view: report.pdf
xpdf report.pdf

report.dvi: components.eps channels.eps

.SUFFIXES: .dia .dvi .eps .pdf .tex

.dvi.pdf:
dvipdf $<
.tex.dvi:
ispell -p dictionary -t $< && latex $< && latex $<
.dia.eps:
dia $< -e $@ -t eps-pango
clean:
rm *.{aux,log,out,dvi} || true
cleaner: clean
rm *.{pdf,eps,bak,dia~} || true

At first I used evince instead of xpdf, but it has some problem with the fonts. So I adjusted the makefile, became root, and installed xpdf. So far so good. But then I forgot to log out root before running ‘make view’… this is where the fun begins.

ispell found some spelling mistake, changed report.tex to fix it, which because of that became owned by root:root. Apart from that and a few other files changing owner, everything went as expected, so I didn’t notice. I edited report.tex a bit, then tried to save it… permission denied! My first response was to insert my USB stick and try to save the file there, and investigate the cause of the problem after that. Not losing work is always most important :) . Guess from which terminal I mounted the USB stick? Yup, mounted as root, so: “cannot create file”. Only then I figured out what I had done.

The funny thing is, I knew Linux couldn’t possibly be malfunctioning this way, and I was pretty sure I had not done anything that could change file permissions, so most likely my system had - somehow - been cracked, and the cracker was now messing with me :D .

If I would more often use the root account by accident, that just might happen.

Now I wonder why I would think a crack is more likely than a random error (by either system or user). After all a crack requires an error too, and most errors can’t be exploited… and I have pretty decent security.

GNU/Linux: less buggy than a human brain.

Leave a Reply