Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Root keeps automatically owning my files

  1. #1
    Join Date
    Apr 2013
    Beans
    10

    Smile Root keeps automatically owning my files

    Hi Folks, this is my first time posting on an IT forum. Here goes...

    I save many downloaded files everyday but somehow they always save as root or root ends up owning them! I can temporarily solve this problem by pressing Alt + f2, opening up 'gksu nautilus'. This opens up a window and allows me to browse for the file that is owned by root, go into properties, permissions and change the owner from root to myself (alan). However, i then go back to work and download files again and they automatically save or are owned by root. What can i do to stop root automatically owning my files? I suspect this may have been a problem from a techie sorting a problem on my laptop recently.

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Root keeps automatically owning my files

    Hello and welcome

    The only way that should happen is if whatever application you are downloading with is running as root e.g. if you use 'gksudo firefox'. How exactly are you downloading?

  3. #3
    Join Date
    Apr 2013
    Beans
    2

    Re: Root keeps automatically owning my files

    Quote Originally Posted by steeldriver View Post
    Hello and welcome

    The only way that should happen is if whatever application you are downloading with is running as root e.g. if you use 'gksudo firefox'. How exactly are you downloading?
    If I may add to this...may also happen in command line if you're using sudo.

    I.e.
    Code:
    sudo wget http://reallysweetdownload

  4. #4
    Join Date
    Apr 2013
    Beans
    5

    Re: Root keeps automatically owning my files

    Make sure your downloading app is not setuid root.

  5. #5
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,835
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Root keeps automatically owning my files

    That techie may have used a shortcut to automatically save files as root by setting the Set User ID bit on firefox or any other program you use for your downloads. You can check the permissions for that program. For firefox use
    Code:
    ls -l /usr/lib/firefox/firefox*
    (/usr/bin/firefox is only a symlink)
    The lines it returns should start with "-rwxr-xr-x". If the SUID has been set it will show "-rwsr-xr-x" instead.

  6. #6
    Join Date
    Apr 2013
    Beans
    10

    Re: Root keeps automatically owning my files

    Hi Impdavidus,

    Sorry for late reply, i was expecting to get a notification mail about a reply to my post/thread.

    Your correct i think and the files owned by root usually are freshly downloaded files.

    I just entered the command on terminal that you recommended and i got the below:

    -rwxr-xr-x 1 root root 87500 Mar 29 07:07 /usr/lib/firefox/firefox
    -rwxr-xr-x 1 root root 2740 Mar 29 06:08 /usr/lib/firefox/firefox.sh


    What do you advise?

    Thanks again

  7. #7
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,835
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Root keeps automatically owning my files

    This means the setUID bit is not set on firefox, so Tim Bob's suggestion does not explain why any downloads by firefox become root-owned. Do you use any other programs for downloading? Maybe you can test another program, like wget. And when you start your browser you don't have to type your password, right? Because I assume you would have told us if that were the case.

    The nasty thing is, if firefox has the permission to make root-owned files it also has the permission to modify system files, so any security leak in firefox can damage your entire system instead of just your home directory.

  8. #8
    Join Date
    Apr 2013
    Beans
    132
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Root keeps automatically owning my files

    1. First of all, I assume you did not login as root, but as a regular user (uid, gid > 1000)
    You can check this with the command id in a terminal. Please do so just to make sure.

    2. Where are you saving the files? Do you download them on your desktop in your /home partition with regular files or do you use another mounted drive for music/movies? You might have some unusual uid/gid settings if you're mounting a partition for downloads. Please go into the same directory where you're saving your downloaded files and write in a terminal:

    Code:
    touch testfile
    ls -l testfile
    You have to be logged in with the same username you're using when you download files. Please post the results.

    And please do a ls -l on one of the downloaded files, too, just to see the permissions, not only the user and group.
    Last edited by clearski; April 26th, 2013 at 07:25 PM.

  9. #9
    Join Date
    Apr 2013
    Beans
    10

    Re: Root keeps automatically owning my files

    Hi Clearski,

    1. I just ran the id in the terminal and came up with the following:

    uid=1000(alan) gid=1000(alan) groups=1000(alan),4(adm),20(dialout),24(cdrom),27( sudo),30(dip),46(plugdev),109(lpadmin),113(netdev) ,124(sambashare)

    2. When i download files they automatically save into my 'download directory' on my laptop hard drive (i presume). Let me try to reboot just to check that im logged in as the admin coz my password wasn't asked for in my las few power ups of the laptop. ill then enter that code into terminal and give you the result.

    REgarding your above ("Please go into the same directory where you're saving your downloaded files and write in a terminal:")
    Sorry but my knowledge of 'directories' is not so good, how do i write a code in terminal in this directory, please explain.

    also, i dont understand how to do this "And please do a ls -l on one of the downloaded files, too, just to see the permissions, not only the user and group."

    thanks

  10. #10
    Join Date
    Apr 2013
    Beans
    10

    Re: Root keeps automatically owning my files

    Hi Impavidus, Yes, i use download helper for downloading youtube and other videos. I also use transmission for torrents. Any advice?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •