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

Re: All settings are lost at logout





Den 2016-11-21 18:36, skrev David Wright:
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.




Hi Gene, Greg, David and Brian,

Thank you for answer and suggestions. They are all founded in a suspicion that I have lost the ownership of, or at least the access to my files, especially the config files in my home directory. I had really no feeling that this is the case, as, despite the bad behaviour I described initially, the environment is working, and I can use the programs I have installed. Also the printer is working.

But I made a test via this command sequence:

sudo find /home/<myUserId> -regex ".*/\.?*.*" -ls | awk '$5$6 !~ /<myUserId>/'

which filtered out all those files where my user id neither own a file or directory nor my group has access. The total number of files and directories (the part before the pipe bar) is 281502 and to 26 of them I or my group have no admittance. They have the root as owner and group. None of these 26 is a configuration file. Most of the files owned by root but with access from my group are those on a few vfat (fat32) partitions, which I have to make it possible to reach the data also from MS Windows. Even if this is very rare nowadays, I want to keep the possibility.

Because of this investigation I do not think that the reason to my issue is bad access to configuration files. Hope someone has more ideas.

By the way 1, echo $LOGNAME printed my login id.
By the way 2, regarding Brian's comment: I gave no root password at the install, so I cannot login as (or su to) root, and neither I want that.

Best regards
Kaj


Reply to: