• Email
  • Like
  • Save
  • Private Content
  • Embed
 

chmod -x chmod

by

  • 140K views

Video at http://www.youtube.com/watch?v=DTWZqh64RcQ. ...

Video at http://www.youtube.com/watch?v=DTWZqh64RcQ.

You're in a Data Center, with absolutely no contact with the outside world, with a machine that you must not restart, and someone performed a `chmod -x chmod`.

This is a problem we used in interviews during 2009, and this presentation is a list of some of the possible solutions that my co-workers at SAPO have suggested.

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

© All Rights Reserved

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

66 Embeds 7,181

http://www.ende-der-vernunft.org 1474
http://blog.kwasd.ru 839
http://blog.matthew.org.pl 831
http://www.redditmedia.com 807
http://www.shortcut.ru 609
http://krypted.com 494
http://shriphani.com 406
http://www.macdac.ru 389
http://www.joanabotto.com 290
http://elkosmas.gr 226
http://www.musiques-incongrues.net 167
http://www.blog.manhag.org 126
http://www.etanonline.fr 117
http://www.younic.de 81
http://paper.li 54
http://pcampitiello.blogspot.com 44
http://pcampitiello.blogspot.it 39
http://www.robintel.ro 25
http://interactivestemlearningprogramsk-12.blogspot.com 17
https://twitter.com 16
http://static.slidesharecdn.com 12
http://iam-chen.com 12
http://a0.twimg.com 10
http://twitter.com 9
http://cetys.blackboard.com 6
http://webcache.googleusercontent.com 6
http://manhag.org 6
http://pcampitiello.blogspot.com.br 5
http://j-reference.blogspot.com 4
http://tumblr.ramimassoud.com 4
http://beta.shortcut.ru 3
http://translate.googleusercontent.com 3
http://www.linkedin.com 3
http://us-w1.rockmelt.com 3
http://feeds.feedburner.com 3
http://feeds2.feedburner.com 3
http://xss.yandex.net 2
http://interactivestemlearningprogramsk-12.blogspot.co.uk 2
http://www.netvibes.com 2
http://classztoop.blogspot.com 2
http://www.manhag.org 2
https://www.shortcut.ru 2
http://unixfreunde.de 2
http://pcampitiello.blogspot.fr 2
http://pcampitiello.blogspot.be 1
http://interactivestemlearningprogramsk-12.blogspot.de 1
http://pcampitiello.blogspot.fi 1
http://cache.baidu.com 1
https://si0.twimg.com 1
http://pcampitiello.blogspot.mx 1
http://pcampitiello.blogspot.com.es 1

More...

Statistics

Likes
39
Downloads
337
Comments
14
Embed Views
7,181
Views on SlideShare
133K
Total Views
140K

110 of 14 previous next Post a comment

  • stryng Miguel Tavares http://ubuntuforums.org/showthread.php?p=11893791#post11893791 1 year ago
    Are you sure you want to
  • dilesoft Dmitry Lejkin at Пиратская Партия России mmm... chmod from c system call will not work? 1 year ago
    Are you sure you want to
  • rxxluowei rxxluowei mark 2 years ago
    Are you sure you want to
  • sac2279 sac2279 exec chmod +x chmod 2 years ago
    Are you sure you want to
  • stevebeattie stevebeattie On linux, it’s much, much easier. You see, when you execute an ELF executable, the kernel does some mapping and then hands the rest of process setup off to ld.so(1), which is treated somewhat like a (hardware backed) interpreter for ELF files, much like /bin/sh inteprets shell scripts, perl interprets perl scripts, etc. And just like you can invoke a shell script without the executable bit via ’/bin/sh your_script’, you can do:

    # /lib/ld-linux.so.2 /bin/chown +x /bin/chown

    or on x86_64 systems:

    # /lib/ld-linux-x86-64.so.2 /bin/chown +x /bin/chown

    (paths are taken from an Ubuntu 10.10 system and may vary on other distros.)
    2 years ago
    Are you sure you want to
  • gnrfan Antonio Ognio, Software Developer / Ingeniero de Sistemas at Aureal Systems S.A.C, Miraflores, Perú I totally thought of the same kind of solution presented by Kevin Benton in the second comment. You still have read permission on the original chmod binary so if you simply dump its contents into another file that already has executable permissions you’ll be fine. In order to avoid ’sacrificing’ any other executable you can simple make a copy of any working executabe and you’re done.

    I immediately thought of something like this:

    $ sudo su -
    # cd /bin
    # cp bash chmod2
    # cat chmod > chmod2
    # chmod2 +x chmod
    # rm chmod2
    # exit

    Just tried in on my Macbook starting from chmod -x /bin/chmod and it works perfectly fine.

    Only cp and cat needed with this approach.
    2 years ago
    Are you sure you want to
  • DustinMorro Dustin Morro Wow my brain hurts. :( 2 years ago
    Are you sure you want to
  • KevinBenton Kevin Benton This one is easy, just ’mv /bin/chmod /bin/chmodold’ then ’cp /bin/chown /bin/chmod’, and finally ’cat /bin/chmodold > /bin/chmod’.
    It's incredible that they came up with so many convoluted answers and skipped this.
    2 years ago
    Are you sure you want to
  • AlexPilosov Alex Pilosov debugfs, change permissions in there. may need to flush things out of cache. 2 years ago
    Are you sure you want to
  • AlexButcher Alex Butcher A bit round about, but create a dummy file, mkdosfs it, mount it loopback, then copy the chmod binary into it. 2 years ago
    Are you sure you want to

110 of 14 previous next

Post Comment
Edit your comment

chmod -x chmod chmod -x chmod Presentation Transcript