-3

I had a brilliant idea to change my /usr file permissions to 0744 using 'sudo chmod 0744 /usr' while I was trying to install a program. So now I can't access any of my files, my home directory 'home/username' doesn't exist apparently (which isn't true), and all commands that are located in the /usr/bin folder are 'do not exist', which also isn't true.

I think the reason for the commands not existing is because I don't have write/execute permissions on the /usr/bin folder (owned by root), but I don't know why my home folder 'does not exist'.

My question is what exactly have I done, and how do I fix it, if possible?

As a side note, the computer is now having a problem when I try to turn it on. It immediately goes to a blinking cursor (top left) and black screen, but I can ssh into the machine. Finally, I don't have access to the root user or a root shell on this machine.

Solved:

So what happens when you run a command like sudo chmod 744 /usr is that all users on the network get locked out of the home folders as well as making it impossible for the computer to boot (hence the black screen with a blinking cursor). Also, more technically, your root file system (/dev/sda1 for me) becomes read-only.

Since you can't boot the computer, you need to go into single user mode from the grub menu. Next, run the command mount -o remount, rw /dev/(your root file system, possibly sda1). This will remount your root file system as read only. Then, run the command chmod 755 /usr. This will of course change the file permissions to read,write, and execute for the owner of the files and read/execute for group and world users.

dbep
  • 647
  • 6
  • 20

1 Answers1

1

You need to login as root, or boot the computer into single-user mode, and then execute:

chmod 755 /usr

You won't be able to do this with sudo because that command is in /usr, and without execute permission you can't access anything in it.

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • Thanks! I was thinking that that is how to fix it. The only problem is that I don't have access to the root account. So I guess the only option is to boot the computer into single-user mode. How would I do that? – dbep May 14 '16 at 00:12
  • All your questions really belong on askubuntu.com. But surely you know how to google "boot ubuntu single user". – Barmar May 14 '16 at 04:06
  • Thanks for your answer. After figuring out some other things, I managed to fix it. The problem was that the computer wouldn't boot passed the a black screen with blinking white cursor. And also the normal tutorials weren't working for booting into single user mode. But after I ran a check on the hard drive the computer decided to boot to the grub menu... Still don't know why it happened that way. Anyway thanks again – dbep May 15 '16 at 12:05