Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Well, I was being lazy to properly setup the properties of the files and now I set up the permissions recursively the folders /etc/ and /var/ to 777. Now I can't ssh into the machine but worse I can't even login as root into the machine anymore to change the permissions back.

Is there any fix or is it just easier to reisntall the OS?

I am using CentOS6.4

Thank you.

share|improve this question
    
What error do you receive when you attempt to login as the root user? Seems strange that global rwe flag would prevent you from logging in. –  Ramhound Sep 24 '13 at 18:06
    
what are you having trouble with specifically? with 777 everybody should be able to access everything. ALso, you say that you can no longer SSH to the box. If, for some reason, this messed up ssh, you're going to need to sit down at the computer. tut here on recovering root password. From there you can set the permissions to whatever you would like. Also here on Askubuntu someone seems to have had a similar problem. Adapt their commands to your situation. –  PsychoData Sep 24 '13 at 18:08
    
This answer also helps with fixing permissions back to normal. askubuntu.com/a/115362 –  PsychoData Sep 24 '13 at 18:10
    
Remember to always include the error messages you get. –  terdon Sep 24 '13 at 18:21
2  
I usually link unix.stackexchange.com/questions/12998/… to questions like these. The link handles the more severe case of recursively 777ing /, and argues that it might very well be less work to reinstall, depending on how your system setup looks. It is very well worth thinking about, in my eyes. –  Daniel Andersson Sep 24 '13 at 18:24
add comment

2 Answers

You won't need to reinstall. One option is to boot off an installer image and then mount the storage device (make sure to do it as read-write), go in and manually fix the mounted copy, then boot back into your installed OS.

share|improve this answer
add comment

The "problem" is that SSH is ignoring your private keys because they are world readable. You can simply log into the server over a console and change the permissions on the file.

Have a look at section 3.14 of this document for what to change. (You can fix the permissions on your private keys or disable StrictModes in your config)

share|improve this answer
    
From the original question, I don't believe that console access will work either. –  Brian Knoblauch Sep 30 '13 at 13:12
    
It should, except he can't log in as root. This generally means logging in as the user who set up the computer and issuing the command "sudo su" or "sudo /bin/bash" to get root access. –  davidgo Sep 30 '13 at 17:10
    
I was operating under the belief that root wouldn't login from console due to /etc/passwd being 777, rather than it being disabled. I'm not familiar with CentOS specifically anymore. –  Brian Knoblauch Sep 30 '13 at 18:37
    
I would be extraordinarily surprised if the permissions on /etc/password were checked, and only marginally less if /etc/shadow were checked. The "login as root" limitation is much more likely to be with /etc/securetty not allowing root logins from the console. –  davidgo Sep 30 '13 at 19:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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