[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: All settings are lost at logout



On Mon 21 Nov 2016 at 12:23:49 (-0500), Gene Heskett wrote:
> On Monday 21 November 2016 11:58:39 Greg Wooledge wrote:
> 
> > On Mon, Nov 21, 2016 at 11:53:35AM -0500, Gene Heskett wrote:
> > > Call up a terminal, and type:
> > >
> > > cd
> > > sudo chown -R yourusername:yourusername *
> >
> > This will miss the dot files, and the home directory itself.
> >
> > sudo chown -R "$LOGNAME:$LOGNAME" .
> >
> True, my bad.  OTOH, if he has somehow lost ownership of /home/him, he 
> has a much larger problem, and he will need to become root and cd 
> to /home, then use your command line verbatum, but I would first
> 
> echo $LOGNAME
> 
> To find out who the system really things he is.
> 
> > And of course, you are doing this interactively, NOT in a script,
> > which means you should notice if the cd fails.  If the cd fails, DO
> > NOT run the chown command.
> 
> Yep, he has much bigger problems in that event.
> 
> > It would also be a good idea to *check* the ownerships of everything
> > before doing the chown, just to make sure you're solving the correct
> > problem.
> 
> In my case thats around 35 Gb of stuff to sift thru as my email corpus 
> goes back to around 2002 in some maildirs. Since I should absolutely own 
> everything in my ~/usr directory, its just easier to let the system do 
> it since it can't hurt anything.  I don't know of, or am not familiar 
> with, any tool in our bag of tricks that could easily find the missed 
> ownership(s).

Well, you could start from

# find / -mount -not -group 0 -exec ls -ld {} \; -o -not -user 0 -exec ls -ld {} \;

which is for listing all non-root.root files on a root filesystem.
Substitute an appropriate pathname for / and user number for 0.

> Obviously the thought of doing that at the filesystems root = / would 
> inflict damages similar to an rm -Rf. Common sense will be needed.

Cheers,
David.


Reply to: