Home Folder Keeps changing ownership to root

Kernels & Hardware, configuring network, installing services

Home Folder Keeps changing ownership to root

Postby williamk » 2017-05-26 16:18

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?
williamk
 
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

Postby phenest » 2017-05-26 16:44

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?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

Postby williamk » 2017-05-26 16:56

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.
williamk
 
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

Postby stevepusser » 2017-05-26 17:15

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?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: AzPainter 2.0.6, Pale Moon 27.4.0, Liquorix kernel 4.11-9, mpv 0.25.0, Kodi 17.3, Ksnip 1.3.1, Mesa 13.0.6
User avatar
stevepusser
 
Posts: 8403
Joined: 2009-10-06 05:53

Re: Home Folder Keeps changing ownership to root

Postby williamk » 2017-05-26 19:19

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

Did I do it wrong? I
williamk
 
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

Postby phenest » 2017-05-26 19:23

NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

Postby phenest » 2017-05-26 19:47

What happens if you change to root with su, and then run a command? Or does it only happen with sudo?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Home Folder Keeps changing ownership to root

Postby williamk » 2017-05-26 20:25

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.
williamk
 
Posts: 6
Joined: 2017-05-26 16:06

Re: Home Folder Keeps changing ownership to root

Postby Bulkley » 2017-05-26 21:13

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.
Bulkley
 
Posts: 5184
Joined: 2006-02-11 18:35

Re: Home Folder Keeps changing ownership to root

Postby debiman » 2017-05-29 18:43

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?
User avatar
debiman
 
Posts: 1017
Joined: 2013-03-12 07:18

Re: Home Folder Keeps changing ownership to root

Postby williamk » 2017-07-13 15:05

Not sure what I did to be honest. But have not had the problem since.
williamk
 
Posts: 6
Joined: 2017-05-26 16:06


Return to System configuration

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable