0

guys!

This is my first post here and, unfortunately, and it's being made in very ugly circumstances! I'm running Debian Jessie x64 and an hour ago I installed some fonts for figlet into the /usr/share/figlet directory. I couldn't use them because I was unzipping them with sudo and they didn't have the proper permissions. Without giving it much thought I ran sudo chmod 644 .* Now nothing works(the browser, even Terminator can't find its icons, etc). I read a few minutes ago that the sudo working directory is the root's home and now I'm frankly panicking!

I have two questions: what exactly did I do(did I change all the permissions on everything on my system to 644?) and how do I revert it barring a full backup restore?

I ran two searches looking for files and directories that were modified in the last hour, but that wasn't very productive. I googled for answers, but couldn't find an answer pertaining to the exact command that I ran, hence I'm posting a dedicated question-I want to know exactly what happened.

I'm very curious about what I did because the newly-unpacked figlet fonts themselves were left with their permissions unchanged!

Thank you very much in advance!

  • What is the directory that you run the command from ? – Wissam Roujoulah Dec 6 '16 at 7:25
  • It was run from the /usr/share/figlet directory. But it was run with sudo and that changes the working directory to root's, hence the question. – Max Dec 6 '16 at 7:30
  • 1
    it did not. sudo doesn't change the directory – Wissam Roujoulah Dec 6 '16 at 7:33
  • @WissamAl-Roujoulah Hey man, your tip totally worked! It was the share directory's permissions that got screwed up. Why did you remove your comment? I'd like to thank you separately-can I +1 or +rep you somehow? I'm just not very familiar with how this works here! – Max Dec 6 '16 at 8:04
  • 1
    @Max welcome to Unix.SE! Wissam deleted his answer which wasn't quite correct (chmod 755 /usr/share/* wouldn't restore the permissions on /usr/share itself), so you can't reward him directly. – Stephen Kitt Dec 6 '16 at 8:11
5

Assuming you're running Bash (with typical settings), running

sudo chmod 644 .*

from /usr/share/figlet would end up running

sudo chmod 644 . ..

(echo .* will display . ..).

This is equivalent to

sudo chmod 644 /usr/share/figlet /usr/share

Fixing your system is straightforward:

sudo chmod 755 /usr/share /usr/share/figlet
  • Thank you, this exhaustively answers both of my questions! Now I know exactly what the command does with the arguments that I've used! But I kind of went on the tip of the other guy who answered here first-is there a way I can rep him somehow? I'm very new to how this whole dealio works here. And a huge thanks to you, again! – Max Dec 6 '16 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.