LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-08-2009, 10:11 AM   #1
Legolas891
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Rep: Reputation: 15
Exclamation Root permission changed


Well guys...i've made a big mistake.I've changed accidentally the permission of the root folder (not /root,but / )
Since then,all my applications and servers are messed out.What i can do to change it back without reinstalling the OS.
Thanks.
 
Old 07-08-2009, 10:19 AM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
How exactly did you change it? Recursively or not? Do you have the command you used? If only one or two files are changed, you can restore it. If it was done recursively, there's probably no way to change it back.
 
Old 07-08-2009, 10:20 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello Legolas891

Have you only changed the permissions of the / directory or have you changed the permissions on sub-directories and files?

Best
 
Old 07-08-2009, 10:40 AM   #4
Legolas891
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Recursively...i used chmod -R 777 /some-dir..and after that i wanted to erase it..and i accidentally hit enter when the pointer erased some-dir. :|
After i noticed,i wanted to change it back...and used 666,but i did much more damage than the first time :|
Isn't there a program that checks all the vital files permissions,or something like that?
 
Old 07-08-2009, 11:06 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Please fill in your distro details in your user profile.
It may help us help you faster/more efficient/qualitatively better.
 
Old 07-08-2009, 11:13 AM   #6
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Quote:
Originally Posted by Legolas891 View Post
Recursively...i used chmod -R 777 /some-dir..and after that i wanted to erase it..and i accidentally hit enter when the pointer erased some-dir. :|
After i noticed,i wanted to change it back...and used 666,but i did much more damage than the first time :|
Isn't there a program that checks all the vital files permissions,or something like that?
Sorry, your best bet is a reinstall. I don't think such extensive damage is reparable, and even if it is, reinstalling will be much faster.
 
Old 07-08-2009, 11:23 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Uncle_Theodore View Post
I don't think such extensive damage is reparable, and even if it is, reinstalling will be much faster.
Depending on the distribution that statement may be false or true. Without knowing those details I think it's at least premature to say that.
 
Old 07-08-2009, 11:25 AM   #8
Legolas891
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Original Poster
Rep: Reputation: 15
I have OpenSUSE 11.There isn't any other option?I don't want to reinstall the OS.I have apache,mysql,ftp,and other servers,script and other stuff...and i don't want to do all the hard work of configuring all of them...
 
Old 07-08-2009, 11:30 AM   #9
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Quote:
Originally Posted by unSpawn View Post
Depending on the distribution that statement may be false or true. Without knowing those details I think it's at least premature to say that.
If you say so. Which distributions can be easily repared after a total screw up of the root directory?

Quote:
Originally Posted by Legolas891 View Post
I have OpenSUSE 11.There isn't any other option?I don't want to reinstall the OS.I have apache,mysql,ftp,and other servers,script and other stuff...and i don't want to do all the hard work of configuring all of them...
You should, of course, save all you data as well as configuration files before reinstalling. Their content should not be affected.
 
Old 07-08-2009, 12:21 PM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Legolas891 View Post
I have OpenSUSE 11.
The SuSE installer CD has a repair option which can fix problems. I don't use SuSE but the command 'rpm --setperms' (or 'rpm -qa | xargs rpm --setperms' or maybe 'rpm -a --setperms') should do the same. After you're done it can also verify packages which should be the equivalent of running 'rpm -qVva'. The only requirement for all of this is that the RPM database exists on the disk or on a backup medium.

Last edited by unSpawn; 07-08-2009 at 12:25 PM. Reason: //commands
 
Old 07-08-2009, 01:00 PM   #11
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Hm... You might be right here. I'll make a note of that.
http://www.cyberciti.biz/tips/reset-...ermission.html
 
Old 07-09-2009, 01:08 AM   #12
Legolas891
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
The SuSE installer CD has a repair option which can fix problems. I don't use SuSE but the command 'rpm --setperms' (or 'rpm -qa | xargs rpm --setperms' or maybe 'rpm -a --setperms') should do the same. After you're done it can also verify packages which should be the equivalent of running 'rpm -qVva'. The only requirement for all of this is that the RPM database exists on the disk or on a backup medium.
I've trided 'rpm -qa | xargs rpm --setperms' but it gaves me a lot of 'No such file or directory'
 
Old 07-09-2009, 01:46 AM   #13
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
Maybe a security auditing program would help. Perhaps udate-test-security or yast2-security, if run, would be able to diagnose and fix the problems.

Actually, the YaST2 submenu 'Security' should, I think, be able to fix it. SuSE, back when I used it (8.2), had preset permissions settings in the /etc/ file (these files being permissions, permissions.easy, permissions.secure, and permissions.paranoid.) These settings could be accessed by YaST2 under the submenu 'Security'.

Last edited by mark_alfred; 07-09-2009 at 02:06 AM. Reason: thinking back to the days when I used SuSE
 
Old 07-09-2009, 03:20 AM   #14
Legolas891
LQ Newbie
 
Registered: Apr 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by mark_alfred View Post
Maybe a security auditing program would help. Perhaps udate-test-security or yast2-security, if run, would be able to diagnose and fix the problems.

Actually, the YaST2 submenu 'Security' should, I think, be able to fix it. SuSE, back when I used it (8.2), had preset permissions settings in the /etc/ file (these files being permissions, permissions.easy, permissions.secure, and permissions.paranoid.) These settings could be accessed by YaST2 under the submenu 'Security'.
Ok,i'll give it a try.But the problem is that the ssh server won't start...

L.E.-It's started..but it rejects my connection.
It says:
ssh_exchange_identification: Connection closed by remote host
And with -vv:
OpenSSH_5.1p1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to "ip" port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

Last edited by Legolas891; 07-09-2009 at 03:29 AM.
 
Old 07-09-2009, 03:34 AM   #15
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
Do you need the ssh server to check YaST? Presumably YaST is on your local machine. Open the YaST control centre and click the "Security and Users" menu item. There might be something there to assist you, I would think.

Last edited by mark_alfred; 07-09-2009 at 03:36 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Security permission changed: how can i fixed? wegadnie Linux - General 2 11-03-2008 06:31 PM
I changed the permission of root recursively all 777..... how to recover now?? Ankit Sharma Linux - Newbie 16 03-21-2008 04:16 AM
File permission suddenly changed daemonkl *BSD 8 10-16-2007 01:18 AM
TROUBLE: MISTAKENLY CHANGED PERMISSION OF OS . how to recover mallinath Linux - Newbie 4 06-29-2005 03:21 PM
permission changed after get thru ftp for a ELF linuxforever Linux - Networking 0 07-24-2003 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:48 AM.

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
Open Source Consulting | Domain Registration