LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-07-2015, 06:07 AM   #1
kirthanshetty
LQ Newbie
 
Registered: Nov 2011
Posts: 9

Rep: Reputation: Disabled
Permission


Hi,
By mistake i have given permission chmod -R 777 /etc on Ubuntu, Can you please help me how to fix it ?
 
Old 01-07-2015, 06:26 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,438

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
I'm afraid you need to reinstall the system.
 
Old 01-07-2015, 06:59 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,429
Blog Entries: 12

Rep: Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893
Quote:
Originally Posted by pan64 View Post
I'm afraid you need to reinstall the system.
Besides it being not a mainstream thing that they've done. What's the impact here? Most of the files/directories in there are 755 anyways, now stuff can be written/erased. Yep that's risky. I agree that recovery is near impossible and re-install is the best way to fix it. But I think it's not urgent and they should therefore be aware of the risk they've added but also be aware that a re-install is not always a simple drop in the bucket for everyone.

Or better yet, @kirthanshetty:
What's the system doing now that you've done that chmod? Is it still just operating normally but you said to yourself "Oh-Oh, didn't mean to do that, and I probably should undo it?"
 
Old 01-07-2015, 07:25 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,438

Rep: Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770Reputation: 2770
as far as I know there are some daemons/apps which refuses to use config files with improper permissions.
 
Old 01-07-2015, 07:45 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,702

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
Quote:
Originally Posted by kirthanshetty View Post
Hi,
By mistake i have given permission chmod -R 777 /etc on Ubuntu, Can you please help me how to fix it ?
You might make a directory listing and post it (in sections if it isn't too long).

The most significant files and directories to change are those with the logins (/etc/passwd, which should be 744, /etc/shadow, which on my system is 000), then there are the system update configurations (usually 644), ssh (766 as it is a directory), and the contents of ssh (set them all to 600, then add read to ssh_config, and *.pub, though deleting and rebuilding the keys can be considered better).

Most of the rest, regular files would be 644, directories 755.

This will NOT fix everything. For instance wpa_supplicant.conf on my system is 600, which restricts it to root only.

You might check your install utility - sometimes there is an option to just fix ownership and access modes of install files without actually doing an install. This still won't necessarily fix everything, as local installation may have files with their own needs.

It is one reason I do backup the root filesystem - it lets me restore certain things after an accident like this (yes, I've done it too).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ext4 - permission to create/modify a file without 'delete' permission BeachHead Linux - General 4 06-08-2014 07:34 PM
File & Folder Permission and Ownership permission error in Cloud storage. rhcekumaran Linux - Newbie 3 06-14-2013 04:41 AM
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
i have given chmod 777 permission for access now how to revert that permission mohdsuboor23 Linux - Server 1 12-11-2010 05:19 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration