0

During resolving another problem I run this command :

pkexec chmod 0440 /etc/sudoers

pkexec chmod 0440 /etc/sudoers.d/README

mount -o remount,rw /

Than after error occurs and after reopen the terminal than it comes as

bash: /etc/bash.bashrc: Permission denied
I have no name!@lappyname:~$ 
6
  • 3
    What was this other problem that you tried to fix with these commands?
    – muru
    Sep 15, 2014 at 11:26
  • error as => bash: /etc/bash.bashrc: Permission denied I have no name!@lappyname:~$ Sep 15, 2014 at 11:28
  • what mean by : Permission denied I have no name! Sep 15, 2014 at 11:29
  • 1
    That's not what I asked. Also see superuser.com/questions/759387/…
    – muru
    Sep 15, 2014 at 11:31
  • O sorry! I was try this command $ sudo chmod -R 777 /etc/ Sep 15, 2014 at 12:16

1 Answer 1

1

Running sudo chmod -R 777 /etc/ was a stupid thing to do. You probably recognise that now but you've set every file in /etc/ and its subdirectories to be readable, writable and executable by any account on the system. The files in there are mostly root owned and have permissions set for security... To stop just anybody or anything overwriting, deleting or maliciously editing your core system configuration.

Some applications (like the authentication and sudo systems) demand that these files are kept securely and won't function if you fight that.

Somebody with enough expertise could probably fix this... But it's an uphill struggle from the off. You need to get into recovery mode, and reset all the files permissions back to what they were. And, no they weren't all the same.

For somebody closer to the novice end of the scale, a reinstall is the recommended course of action. It's probably faster —regardless of experience— and it's almost certainly going to leave you with a better result.


Having written this I can see that the commands in the question are in fact trying to rescue the system but yeah, this requires an understanding of what's happening. For instance you'd certainly need to remount as rw before you could affect any change on the disk in recovery mode. Remounting afterwards wouldn’t help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .