How not to change your resolution



  • A few years ago the company I was with was in the beginning phase of a
    very large facilities management project for an even larger
    airport.  We were putting together a "proof of concept" using some
    of our existing embedded boards and a few linux workstations, and it
    fell to me to load Linux onto the allocated boxes.  Thankfully
    there were two, as I'll explain later.



    A few days after I had loaded the boxes and turned them over to the
    consulting firm we'd hired to do that portion of the development, their
    leader-type person calls me up and the conversation went something like
    this:



    him: I've got one of the linux machines that won't boot, can you help?

    me: yeah, I think so - what's it saying when it fails?

    him: it says it can't mount the hard drive and stuff like that - it keeps saying permission denied.

    me: it shouldn't do that.  did you change anything?

    him: just the screen resolution.

    me (scratching my head): that shoudn't do anything - what did you change it to?

    him: 640x480

    me: that should be fine - I assume you used system-config-display ...

    him: no, I just edited the file and changed it for root

    me: the changes should be for everyone, not just root - I don't think there's a way to specify it for a single user

    him: no, there was a line in the file that said 'root 0:0' and some other stuff, so I changed it to say 'root 640:480'

    me: wait a minute ... what file are you talking about here?

    him: /etc/passwd

    me: okay, I'll be right there <click>.  WTF?!



    Sure enough, somehow I was able to see /etc/passwd and he'd changed the
    UID and GID for root from 0 to 640 and 480, somehow thinking that a
    file named 'passwd' had something to do with X display resolution ...
    brillant!



    I had to remove the hard drive from that machine, place it into the
    other linux box, mount it and fix the passwd file, then take it back
    out again to place back in its proper machine in order to get things to
    work right again.



    I also promptly changed the root password and didn't give him the new one.




  • Or to look in etc, or...
    But I bet the damage was done with Pico or Nano.
    Easy-to-use editors are the real... no, that's not right.



  • Speaking of the root user and desktops and stuff, somehow this situation reminds me of a rather strange occurrance I can't explain.

    I needed shell access on some Internet-accessible unix box--I forget why, but my own box wouldn't do. I think I wanted to use my file server and someone else's together and try something out.

    Anyway, I asked my work buddy, who's got a unix web server/file server connected to his modem/firewall at home, just like mine: "Can you create a user for me so I can try something in an ssh session?" I looked over his shoulder as he created a normal user and then he let me set the initial password. Satisfied, I walked away and intended to return to his server to try my experiment when I had time.

    Meanwhile, my friend was moving some files around, messing with Gallery 2 and whatnot, and he came back to me half an hour later asking if I had any idea how a group of files/folders in his Desktop folder were suddenly owned by me. Quite puzzled, I came back and looked at his VNC session. He was running Gnome as root, and sure enough, a bunch of files on his Desktop were owned by my user. I still had never actually logged in with this account.

    We fixed the problem and I told him he shouldn't be running Gnome as root, but I'm pretty sure he continues to do so.

    Moral: don't ask noobs for shell accounts on their computers, lest you get blamed for--or at least pulled into--really weird problems.



  • @wk2x said:

    Sure enough, somehow I was able to see /etc/passwd and he'd changed the UID and GID for root from 0 to 640 and 480, somehow thinking that a file named 'passwd' had something to do with X display resolution ... brillant!

    passwd = Performance Attributes and Settings for Screen and WinDows. Where else would you set resolution?

    --Rank



  • @hank miller said:

    I find it hard to believe anyone can figure
    out any editor on a unix system and not know what /etc/passwd is. Most
    unixish systems give you vi (of some form). Sometimes you get emacs.
    Both are powerful, but idiots are unlikely to figure out how to exit
    either editor without pulling the plug on the machine.




    In a beginners' course for Unix I took a few months ago, we actually
    learnt which system files do what first and how to use a text editor
    afterward.



    I figure they didn't want to take any chances .



  • @hank miller said:

    I find it hard to believe anyone can figure out any editor on a unix system and not know what /etc/passwd is. Most unixish systems give you vi (of some form). Sometimes you get emacs. Both are powerful, but idiots are unlikely to figure out how to exit either editor without pulling the plug on the machine.

    From the sound of things, he was logged in to the GUI (probably Gnome) as root. He probably just clicked on the file and used the editor (probaly Gedit) that came up; Gedit is no harder for an idiot to use than Notepad. That's the problem with making Linux easier to use :-)



  • I haven't tried in this case (and I certainly won't ;-) but in most
    cases, problems with bad config files can be solved by booting into
    single-user mode or even into starting Linux using the kernel parameter
    "init=/bin/bash".



  • @Rank Amateur said:

    @wk2x said:

    Sure enough, somehow I was able to see /etc/passwd and he'd changed the UID and GID for root from 0 to 640 and 480, somehow thinking that a file named 'passwd' had something to do with X display resolution ... brillant!

    passwd = Performance Attributes and Settings for Screen and WinDows. Where else would you set resolution?

    And etc = Each Time Changeable.

    SCNR

    Torsten

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.