Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Home Folder Keeps changing ownership to root

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
williamk
Posts: 6
Joined: 2017-05-26 16:06

Home Folder Keeps changing ownership to root

#1 Post by williamk »

Hi,

Am a newb to Debian so please be patient. For some reason all the directories in my user home folder /home/williamk keep changing ownership to root:root. This creates problems, especially since I have some network shares mounted in /home/williamk/mnt . I can chown -R my home folder back to williamk, but if I switch user to root to do a root function the ownership changes back to root. My user account williamk is in the sudo user group. Is this normal behavior in Debian?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

#2 Post by phenest »

This is not normal behaviour. Nor is using sudo, but that's your choice. Nor is it relevant. What is relevant, and what you haven't mentioned, is the "root function" you perform.

So now some question:
1. What version of Debian are you using?
2. Does the /home/williamk folder change to root, or just its contents?
3. What is the "root function" you mentioned?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

williamk
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

#3 Post by williamk »

Hi,

1. Using Debian 8.8 with Cinnamon Desktop.
2. The williamk home folder itself shows williamk:williamk for owner. Just the contents show all root:root
3. This is a new install. When trying to install some packages I was getting failed messages unless I switched to root. Then they installed. Also to edit /etc/fstab to mount network drives, I had to be root. I figured that was normal.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Home Folder Keeps changing ownership to root

#4 Post by stevepusser »

You should be able to use sudo to perform package installation or edit a system file if that's your choice--you should be able to do it as root, also. This raises the question--did you set up sudo during the install, or later?
MX Linux packager and developer

williamk
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

#5 Post by williamk »

I set up sudo after install with:
apt-get install sudo
usermod -a -G sudo williamk

Did I do it wrong? I

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

#6 Post by phenest »

ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

#7 Post by phenest »

What happens if you change to root with su, and then run a command? Or does it only happen with sudo?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

williamk
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

#8 Post by williamk »

Hmmm, tried running commands with both sudo and as root with su. Now it is maintaining the correct ownership. I will try and stay out of root and just use sudo if need be. Will play with it some more and see if I can figure out what if anything is triggering the change of ownership.

Bulkley
Posts: 6383
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Home Folder Keeps changing ownership to root

#9 Post by Bulkley »

What does your /etc/fstab have for /home ? Mine says

Code: Select all

UUID=eef39e40-bc0a-4edf-ab18-76a7e316a50e /home           ext4    defaults        0       2
The above is on Stretch. Earlier versions had different instructions. Never-the-less, fstab instructions take precedence at boot.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Home Folder Keeps changing ownership to root

#10 Post by debiman »

williamk wrote:I was getting failed messages unless I switched to root.
let me guess: you logged into your GUI wih root, instead of performing sysadmin stuff in the terminal?

williamk
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

#11 Post by williamk »

Not sure what I did to be honest. But have not had the problem since.

Post Reply