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 09-20-2012, 04:39 AM   #1
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Rep: Reputation: 1
Accidiently gave "/" ownership to wrong user....


Hey

I wanted another user to be able to write to "/" but by mistake I made the owner of all the files in "/" to another user. I noticed and tried to change it back and I did. Just in case, I restarted and now Im stuck at the logon screen. It displays and when I try to enter my password, it goes black and just goes back to the logon screen.

What would be the best way to fix this? A format would be ideal (nothing important on it) but its been a couple of days of configuring this server and configuring it AGAIN would just piss me off......

I just want to enter the OS and be able to access (and acutally do stuff)
 
Old 09-20-2012, 05:09 AM   #2
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Ive been able to access a root shell (thank god)

would a

chown -R root:root /

fix everything?
 
Old 09-20-2012, 05:16 AM   #3
sujithspillai90
Member
 
Registered: Jun 2011
Location: India
Posts: 31

Rep: Reputation: Disabled
Yes, it will make the owner and group as root for all the files and directories under / recursively.
 
Old 09-20-2012, 05:47 AM   #4
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Running it now. I thought I was going to reformat this.......
 
Old 09-20-2012, 05:50 AM   #5
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Nothing. Same thing login comes up, I enter my password, black screen, login again comes up, Io enter again my password, black screen, login come up.........etc infinite.


Another issue perhaps?
 
Old 09-20-2012, 05:55 AM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Changing ownership of all files to root will not fix the problem. Do not do it. If your first command was recursively, with "-R" option, then it can be hard to fix (first try to change your user home directory ownership to you), depending on what ditribution you use, what programs installed, etc. Please specify also if you changed only owner or permissions too?
 
Old 09-20-2012, 06:32 AM   #7
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by eSelix View Post
Changing ownership of all files to root will not fix the problem. Do not do it. If your first command was recursively, with "-R" option, then it can be hard to fix (first try to change your user home directory ownership to you), depending on what ditribution you use, what programs installed, etc. Please specify also if you changed only owner or permissions too?
Well, sudo was broken but I have been able to fix it.

I changed owner AND permissions. I changed the ownership of all files to root (like you said NOT to do; Sorry, did it before you replied) and still the desktop does not show up.


I know the system is problably 90% broken but is there any way to get back into the desktop?
 
Old 09-20-2012, 06:37 AM   #8
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Another thing, I change to the terminal on the login screen (Ctrl+Alt+F1) and I cannot login as root .

I can change to root (the user) once logged in though.
 
Old 09-20-2012, 06:45 AM   #9
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Back into the desktop Man that took some time!


I tried different things and changing /tmp to 777 did the trick.
 
Old 09-20-2012, 06:58 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
OK, all of that is nice for being able to get back in but it doesn't really solve things, right? You still have to reset all ownership and permissions. How you do that depends on your distribution. Either list it in your control panel or post here if unsure what to do.
 
Old 09-20-2012, 07:00 AM   #11
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
My MySQL server doesnt start so fuck it; Im reformatting it and reinstall it from sratch.

Too bad Ubuntu doesnt have a System Restore like Windows.
 
Old 09-20-2012, 07:01 AM   #12
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by unSpawn View Post
OK, all of that is nice for being able to get back in but it doesn't really solve things, right? You still have to reset all ownership and permissions. How you do that depends on your distribution. Either list it in your control panel or post here if unsure what to do.
Ubuntu thought I put it, sorry about that.

Im reformatting and reinstalling but I havent hit the next button yet.........
 
Old 09-20-2012, 07:14 AM   #13
riahc3
Member
 
Registered: Dec 2002
Posts: 141

Original Poster
Rep: Reputation: 1
Formatting now.
 
Old 09-20-2012, 09:40 AM   #14
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 12.04/14.04, Scientific Linux 6.3/6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,799

Rep: Reputation: 157Reputation: 157
Word of advice,... make your /home partition separate from / , that is, if you don't already. In that instance, you only have to format the / partition, and can leave /home intact... Fixing just the /home partition's permissions and migrating data after a reinstall or upgrade is easier than having to wipe the drive and resort to backups.

PS: 2nd piece of advice,... instead of changing permissions, you should have just added admin rights to the other user on the sudoers list, or used group permissions to do the same thing, provided that kind of permission structure was compatible with whatever software you were using.

Last edited by JaseP; 09-20-2012 at 09:44 AM.
 
  


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
why `tr "\000" "\125" < /dev/zero | dd bs=1K count=1 of=01data` creates wrong size? albert316 Linux - Newbie 11 11-16-2011 11:08 AM
Gave up on UBUNTU/LINUX due to no support for my "legacy" hardware gtamplin Linux - Newbie 7 11-02-2010 04:41 PM
AMD/ATI drivers installation gave me "out of frequency" vinnie_vinodh Linux - Newbie 5 10-24-2010 06:59 AM
Boot problem - "Gave up waiting for root device.", (initramfs) for ubuntu 9.10 kumar116 Linux - Hardware 2 06-21-2010 05:10 PM
"yum info python" gave me 2 installed items. Why? gneeot Linux - General 3 06-29-2006 02:07 AM

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

All times are GMT -5. The time now is 07:09 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