Default ownership of files

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
lsemmens
Level 11
Level 11
Posts: 3949
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Default ownership of files

Post by lsemmens »

Another question had me looking at various files I have created over the years and many that I have looked at seem to have the ownership as root. which means I cannot change the properties of those files. Some of those files have only been created in the last few days, while others are quite old. I can edit them fine without logging on as root, however, modifying them across my home network can become problematical.

I know that I can take ownership by CHOWN, but, what I want to know is why the ownership seems to default to root, and not the creator? This is a generic problem across all of my Linux machines so cannot blame one install specifically.

Inxi for this machine is unlikely to assist but, just in case

Code: Select all

System:
  Kernel: 5.4.0-132-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 
  Desktop: Cinnamon 5.2.7 Distro: Linux Mint 20.3 Una 
  base: Ubuntu 20.04 focal 
Machine:
  Type: Laptop System: TOSHIBA product: Satellite P70-A v: PSPLPA-01C002 
  serial: <filter> 
  Mobo: Type2 - Board Vendor Name1 model: Type2 - Board Product Name1 
  v: Type2 - Board Version serial: <filter> UEFI: Insyde v: 1.00 
  date: 05/02/2013 
Battery:
  ID-1: BAT1 charge: 46.5 Wh condition: 46.5/56.2 Wh (83%) 
  model: SANYO PA5024U-1BRS status: Unknown 
CPU:
  Topology: Quad Core model: Intel Core i7-4700MQ bits: 64 type: MT MCP 
  arch: Haswell rev: 3 L2 cache: 6144 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 38312 
  Speed: 977 MHz min/max: 800/3400 MHz Core speeds (MHz): 1: 898 2: 899 
  3: 898 4: 898 5: 898 6: 902 7: 898 8: 902 
Graphics:
  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Toshiba 
  driver: i915 v: kernel bus ID: 00:02.0 
  Device-2: NVIDIA GK107M [GeForce GT 745M] vendor: Toshiba driver: nvidia 
  v: 470.141.03 bus ID: 01:00.0 
  Display: x11 server: X.Org 1.20.13 driver: modesetting,nvidia 
  unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: NVIDIA GeForce GT 745M/PCIe/SSE2 
  v: 4.6.0 NVIDIA 470.141.03 direct render: Yes 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  vendor: Toshiba driver: snd_hda_intel v: kernel bus ID: 00:03.0 
  Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Toshiba 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  Sound Server: ALSA v: k5.4.0-132-generic 
Network:
  Device-1: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter 
  vendor: Lite-On driver: ath9k v: kernel port: 5000 bus ID: 07:00.0 
  IF: wlp7s0 state: up mac: <filter> 
  Device-2: Qualcomm Atheros AR8161 Gigabit Ethernet vendor: Toshiba 
  driver: alx v: kernel port: 3000 bus ID: 0d:00.0 
  IF: enp13s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 1.02 TiB used: 743.54 GiB (71.3%) 
  ID-1: /dev/sda vendor: HGST (Hitachi) model: HTS725050A7E630 
  size: 465.76 GiB 
  ID-2: /dev/sdb vendor: Toshiba model: MK5075GSX size: 465.76 GiB 
  ID-3: /dev/sdc model: SSD 120GB size: 111.79 GiB 
  Optical-1: /dev/sr0 vendor: PIONEER model: BD-RW BDR-UD02D rev: 1.00 
  dev-links: cdrom,cdrw,dvd,dvdrw 
  Features: speed: 62 multisession: yes audio: yes dvd: yes 
  rw: cd-r,cd-rw,dvd-r,dvd-ram state: running 
Partition:
  ID-1: / size: 54.15 GiB used: 31.58 GiB (58.3%) fs: ext4 dev: /dev/sdc5 
Sensors:
  System Temperatures: cpu: 69.0 C mobo: N/A gpu: nvidia temp: 65 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 274 Uptime: 2d 16h 19m Memory: 15.39 GiB used: 2.60 GiB (16.9%) 
  Init: systemd runlevel: 5 Compilers: gcc: 9.4.0 Shell: bash v: 5.0.17 
  inxi: 3.0.38 
Last edited by LockBot on Sat May 27, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Fully mint Household
Out of my mind - please leave a message
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Default ownership of files

Post by all41 »

what does this tell about file ownership?

Code: Select all

ll -la
those are all lower case L
file ../ will be owner:group = root
Everything else should be you:you

Also cpu temp is running way high for you laptop.
Mitigate this first, clean the airflow paths and replace the thermal paste.
Everything in life was difficult before it became easy.
User avatar
lsemmens
Level 11
Level 11
Posts: 3949
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Default ownership of files

Post by lsemmens »

Code: Select all

leigh@leigh-Satellite-P70-A:~$ ll -la
total 17972
drwxr-xr-x 30 leigh leigh     4096 Nov 25 10:54 ./
drwxr-xr-x  3 root  root      4096 Oct 14 19:56 ../
drwxrwxr-x  5 leigh leigh     4096 Nov 20 21:52 .audacity-data/
-rw-------  1 leigh leigh      731 Nov 13 21:52 .bash_history
-rw-r--r--  1 leigh leigh      220 Oct 14 19:56 .bash_logout
-rw-r--r--  1 leigh leigh     3771 Oct 14 19:56 .bashrc
drwx------ 26 leigh leigh     4096 Nov 23 14:10 .cache/
drwxrwxr-x  5 leigh leigh     4096 Oct 14 20:05 .cinnamon/
drwxr-xr-x 27 leigh leigh     4096 Nov 24 20:28 .config/
drwxrwxrwx  2 leigh leigh     4096 Nov 27 16:17 Desktop/
-rw-r--r--  1 leigh leigh       27 Oct 15 06:31 .dmrc
drwxrwxrwx  4 leigh leigh     4096 Nov 24 20:30 Documents/
drwxrwxrwx  2 leigh leigh     4096 Nov 23 13:30 Downloads/
drwxrwxr-x  2 leigh leigh     4096 Nov 13 20:41 .dumphd/
drwx------  3 leigh leigh     4096 Oct 15 06:31 .gnupg/
-rw-r--r--  1 leigh leigh      245 Oct 28 09:45 .gtkrc-2.0
-rw-r--r--  1 leigh leigh      516 Oct 14 19:56 .gtkrc-xfce
drwxr-xr-x  3 leigh leigh     4096 Nov 18 23:59 .hplip/
drwxrwxr-x  3 leigh leigh     4096 Nov 23 13:38 .hypnotix/
drwxrwxr-x  2 leigh leigh     4096 Oct 28 09:45 .icons/
drwxrwxr-x  3 leigh leigh     4096 Nov 13 20:41 .java/
drwxrwxr-x  4 leigh leigh     4096 Oct 14 20:11 .linuxmint/
drwxrwxr-x  3 leigh leigh     4096 Oct 15 06:31 .local/
drwx------  3 leigh leigh     4096 Oct 26 12:40 .log/
drwx------  4 leigh leigh     4096 Oct 14 20:15 .mozilla/
drwxrwxrwx  2 leigh leigh     4096 Oct 15 06:31 Music/
drwx------  3 leigh leigh     4096 Oct 31 13:45 .nv/
drwxrwxr-x  2 leigh leigh     4096 Nov  1 12:17 .OpenSong/
-rwxrwxrwx  1 leigh leigh 18214440 Nov  1 12:11 opensong_3.4.8-1_amd64.deb*
drwxrwxrwx  2 leigh leigh     4096 Oct 15 06:31 Pictures/
drwx------  3 leigh leigh     4096 Oct 15 21:51 .pki/
-rw-r--r--  1 leigh leigh      807 Oct 14 19:56 .profile
drwxr-xr-x  2 leigh leigh     4096 Oct 15 06:31 Public/
-rw-r--r--  1 leigh leigh        0 Oct 14 20:12 .sudo_as_admin_successful
drwxr-xr-x  2 leigh leigh     4096 Oct 15 06:31 Templates/
drwxr-xr-x  2 leigh leigh     4096 Oct 14 20:01 .themes/
drwx------  6 leigh leigh     4096 Oct 15 10:47 .thunderbird/
drwxr-xr-x  3 leigh leigh     4096 Oct 16 18:33 .var/
drwxr-xr-x  2 leigh leigh     4096 Oct 15 06:31 Videos/
-rw-rw-r--  1 leigh leigh      181 Nov 13 20:56 .wget-hsts
-rw-------  1 leigh leigh       66 Nov 25 09:19 .Xauthority
-rw-rw-r--  1 leigh leigh      131 Oct 14 20:10 .xinputrc
-rw-------  1 leigh leigh    10616 Nov 28 09:30 .xsession-errors
-rw-------  1 leigh leigh     9069 Nov 24 20:33 .xsession-errors.old
leigh@leigh-Satellite-P70-A:~$ 
Looks like I own everything. Except that File Ownership still shows as root

Duh! Ignore me, Everything I tried this morning has ownership set as me. It occurs to me that the issues might have their origins in Windows as a lot of my files were ported from that environment in the beginning, and thinking about it many of my new documents are based on those old templates. Might need to look run CHOWN on some folders to fix those issues.
Fully mint Household
Out of my mind - please leave a message
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Default ownership of files

Post by all41 »

You can't chown anything in ntfs partitions--ntfs does not assign or recognize ownership:group policies.
Everything in life was difficult before it became easy.
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: Default ownership of files

Post by linux-rox »

lsemmens wrote: Sun Nov 27, 2022 8:21 pm It occurs to me that the issues might have their origins in Windows as a lot of my files were ported from that environment in the beginning, and thinking about it many of my new documents are based on those old templates.
Bingo! When Linux imports files from an NTFS partition, it assigns ownership to root with open permissions (i.e., can be edited by anyone). Are the files still on an NTFS partition? Or have they been copied to ext4? If the former, what all41 said. If the latter, chown should work.
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Default ownership of files

Post by all41 »

linux-rox wrote: Wed Nov 30, 2022 8:35 pm
lsemmens wrote: Sun Nov 27, 2022 8:21 pm It occurs to me that the issues might have their origins in Windows as a lot of my files were ported from that environment in the beginning, and thinking about it many of my new documents are based on those old templates.
Bingo! When Linux imports files from an NTFS partition, it assigns ownership to root with open permissions (i.e., can be edited by anyone). Are the files still on an NTFS partition? Or have they been copied to ext4? If the former, what all41 said. If the latter, chown should work.
Depends on how the mount was created. Indeed home/username may take ownership of the
mount point itself but the files within an ntfs partition are not obliged and do not recognise, record, or remember ownership:group policies
Everything in life was difficult before it became easy.
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: Default ownership of files

Post by linux-rox »

all41 wrote: Sat Dec 03, 2022 6:02 pm Depends on how the mount was created.
Don't mind being corrected, but I don't understand where we disagree. Notice I said copied to an ext4 partition, not mounted to.
User avatar
lsemmens
Level 11
Level 11
Posts: 3949
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Default ownership of files

Post by lsemmens »

Thank you, Part of the issue, upon thinking about it relates to file shares across the network. I have an NTFS drive on my laptop that shares its partition with Windows and Linux (the OS is on a separate drive) All works well from the lappy it's only when I try some file jiggerpokery on my Office PC (which also dual boots) but, typically, lives in Linux, like my Lappy. That machine is not currently running so cannot test. I shall return to it in a day or so.
Fully mint Household
Out of my mind - please leave a message
Locked

Return to “Software & Applications”