Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Uggh... changed ownership of almost everything. Little help?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 420
Location: Tokyo

PostPosted: Mon May 27, 2013 12:33 am    Post subject: Uggh... changed ownership of almost everything. Little help? Reply with quote

I ran chmod 755 * -R in the #$@Q!ing root, instead of somewhere else. Stupid. I realized it when it got to /proc and gave errors. I can SSH in, but I cannot su to root. I still have the root session open though. I changed permissions on /bin/su to be owned by root, but I still get setgid: Operation not permitted setgid: Operation not permitted.

I know this is totally dumb and I should just rebuild. It's Monday morning and I actually have a busy week of work. I won't reboot, but I could lose that session. Can anyone think of a few things I should do to alleviate the pain a little? The first is getting root access whenever I need it. After that, it should all be fixable with some time.
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4563
Location: Saint Amant, Acadiana

PostPosted: Mon May 27, 2013 12:38 am    Post subject: Reply with quote

Considering how fine-tuned are the permissions of a POSIX system ... I'd reinstall.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 420
Location: Tokyo

PostPosted: Mon May 27, 2013 12:57 am    Post subject: Reply with quote

Jaglover wrote:
Considering how fine-tuned are the permissions of a POSIX system ... I'd reinstall.


Yes, I will eventually... but it's Monday morning. Basically the absolute worst time I could do this.
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2208
Location: UK

PostPosted: Mon May 27, 2013 1:42 am    Post subject: Reply with quote

As far as permissions go there aren't many special things in the base system. You need setuid (chmod u+s) on /bin/su, /bin/mount, /bin/umount and maybe /usr/bin/Xorg and that should be enough to get a usable system for the time being.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Mon May 27, 2013 4:27 am    Post subject: Reply with quote

This is one of myriad catastrophic problems easily solved by having backups.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 420
Location: Tokyo

PostPosted: Mon May 27, 2013 5:44 am    Post subject: Reply with quote

Ant P. wrote:
As far as permissions go there aren't many special things in the base system. You need setuid (chmod u+s) on /bin/su, /bin/mount, /bin/umount and maybe /usr/bin/Xorg and that should be enough to get a usable system for the time being.


Cheers -- I can su now, so that's mainly what I need. I'm actually not using X on this box... it's just got my files/sources on it.


Quote:
This is one of myriad catastrophic problems easily solved by having backups.


Indeed. And I back up data. But I've found that I have to rebuild machines often enough to not bother w/ backing up the system though. True, it would have saved me this one time, but over the years I'd have put a lot of time, effort, and space into maintaining system backups which would have been rendered useless b/c the gap between my installed portage version and the current one is too vast. It's happened at least twice, and it doesn't take all that long IMHO. Yes, I could update my portage more regularly, but I've been bitten one too many times when a bad update destroyed my machine (or worse, made something else break and then I have to go find it). Maybe it's better these days... but I can't afford to be a guinnea pig.
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1266

PostPosted: Mon May 27, 2013 5:51 am    Post subject: Reply with quote

Ok, this may be a completely stupid suggestion that would break everything, but could untaring a stage3 in the root directory help? That way, the critical part of the system would be patched up at least temporarily.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2859
Location: Omnipresent

PostPosted: Mon May 27, 2013 6:07 am    Post subject: Reply with quote

kiss-o-matic wrote:
[...] True, it would have saved me this one time, but over the years I'd have put a lot of time, effort, and space into maintaining system backups which would have been rendered useless b/c the gap between my installed portage version and the current one is too vast. [...]

I don't understand this statement for three reasons:

1) If you have a mission critical system that you cannot afford to take offline, then you have no choice but to make backups. Your hard disk or RAID controller could fail at any time.

2) I don't see why a system backup is onerous once it's set up (e.g., see the link in my signature). If you have the resources for a machine, you have resources for an external disk or SAN.

3) I don't see what Portage has to do with keeping backups.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
kiss-o-matic
Guru
Guru


Joined: 19 Jul 2004
Posts: 420
Location: Tokyo

PostPosted: Mon May 27, 2013 6:55 am    Post subject: Reply with quote

My source files are backed up via svn. My data in the cloud.
Worst case scenario is I rebuild the machine (w/o X) which isn't that much time anyway. It would cost me a day. I'll avoid that day if need be. As such, it's not mission critical.

Portage has screwed me more than a few times. Sometimes packages break. Sometimes the system breaks. Sometimes I just can't update due to a gap in versions (or profiles). Either of those suck, but the latter results in me rebuilding. Generally I just know that at some point down the road (every year or so), I'm going to have to lose part of my weekend and rebuild the machine. Probably every other time I'm swapping out disk that has the root on it anyway, so it's not lost time. (And hey, wouldn't you know it, I was just thinking that I need to get a bigger drive).

I realize there is no perfect system and any of that can happen with any package manager. I can make do until I fix this in the case it goes tits up. I wouldn't recommend the philosophy to most other people won't have said resources, but it works for me. This would just happen to be the one time I'd want to roll back.
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 817
Location: PL

PostPosted: Mon May 27, 2013 7:43 am    Post subject: Reply with quote

i'd go over portage installed database, there should be permissions for all installed files somewhere in there.

you might hack up a script to restore whatever is registered as file installed by package in there.
_________________
~amd64, ~x86
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1551

PostPosted: Mon May 27, 2013 8:46 am    Post subject: Reply with quote

yoshi314 wrote:
i'd go over portage installed database, there should be permissions for all installed files somewhere in there. you might hack up a script to restore whatever is registered as file installed by package in there.

yoshi314 ... I don't think there is, /var/db/pkg/<category>/<package>/CONTENTS only contains hashes, and I'm not aware of file/directory permissions being available in any of the other db/pkg files.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum