Results 1 to 9 of 9

Thread: Can't change file permissions from root as owner

  1. #1
    Join Date
    Jul 2008
    Location
    Pretoria, South Africa
    Beans
    124
    Distro
    Ubuntu 9.10 Karmic Koala

    Question Can't change file permissions from root as owner

    [warning: if this question has been asked before please just forward me onto it. I rarely find what I need using the search tool. And if this thread is in the wrong place I am sure a moderator will move it. Thanks]

    A while ago I copied my Home Directory to a removable HDD as a temporary back-up solution. I have since found out that I have lost all ownership of the file to root. I logged on as root (I don't know how to do this in the terminal) and tried to change the the ownership and group permission settings back to my user name but it would keep flipping back to root.

    I am stuck now because I want to compress and archive the folder for history's sake but can't because I am not root. (and no, I don't want to do it as root)

    Please help

  2. #2
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Can't change file permissions from root as owner

    What filesystem is on the removable hard drive? FAT32 and NTFS cannot store unix permissions.

  3. #3
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Can't change file permissions from root as owner

    Quote Originally Posted by glubbdrubb View Post
    [warning: if this question has been asked before please just forward me onto it. I rarely find what I need using the search tool. And if this thread is in the wrong place I am sure a moderator will move it. Thanks]

    A while ago I copied my Home Directory to a removable HDD as a temporary back-up solution. I have since found out that I have lost all ownership of the file to root. I logged on as root (I don't know how to do this in the terminal) and tried to change the the ownership and group permission settings back to my user name but it would keep flipping back to root.

    I am stuck now because I want to compress and archive the folder for history's sake but can't because I am not root. (and no, I don't want to do it as root)

    Please help
    moved to general help.

    As indicated by cdenley my guess would be you copied the files to a FAT or NTFS file system.

    It would help if you posted the exact commands you are running and any error messages you are getting.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  4. #4
    Join Date
    Jul 2008
    Location
    Pretoria, South Africa
    Beans
    124
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't change file permissions from root as owner

    Yes, it is formatted with NTFS. (which is how most of these consumer drives ship. And I need it to stay that way because I need other PC's to read it)

    I did not use any commands to copy or compress the folder. I logged in as root using the GUI (I don't know the commands to do it any other way).

    The error was:

    An error occurred while adding files to the archive.
    Permission denied


    So how can I access and change the files stored on the drive if ntfs does not support permissions?

    What is cdenley?

  5. #5
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Can't change file permissions from root as owner

    Quote Originally Posted by glubbdrubb View Post
    I did not use any commands to copy or compress the folder. I logged in as root using the GUI (I don't know the commands to do it any other way).
    Logging in to the GUI as root is a terribly insecure thing to do.

    Quote Originally Posted by glubbdrubb View Post
    So how can I access and change the files stored on the drive if ntfs does not support permissions?
    You can either change the user you access the files as, or change the way it is mounted to assign it the correct permissions at mount time.

    Quote Originally Posted by glubbdrubb View Post
    What is cdenley?
    I am.

  6. #6
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Can't change file permissions from root as owner

    See this guide for how to set permissions :

    How to fstab - Ubuntu Forums
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  7. #7
    Join Date
    Jul 2008
    Location
    Pretoria, South Africa
    Beans
    124
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't change file permissions from root as owner

    Thanks for your help so far.

    I read through the fstab page but me in my inexperience did not see the part where drive permissions are explained. Please help.

    I do understand the power and danger of root(I have administered XP for 5 years and Admin + average user = trouble). But I have two issues. I don't know the commands to do what I need to do in the terminal and when I do log in as root it is only for very specific functions (like changing file permissions).

  8. #8
    Join Date
    Dec 2006
    Location
    Chicago
    Beans
    3,839

    Re: Can't change file permissions from root as owner

    Quote Originally Posted by glubbdrubb View Post
    Thanks for your help so far.

    I read through the fstab page but me in my inexperience did not see the part where drive permissions are explained. Please help.

    I do understand the power and danger of root(I have administered XP for 5 years and Admin + average user = trouble). But I have two issues. I don't know the commands to do what I need to do in the terminal and when I do log in as root it is only for very specific functions (like changing file permissions).
    This seems pretty relevant:
    VFAT/NTFS:

    Ownership and permissios of vfat / ntfs are set at the time of mounting.
    Also, running nautilus as root is much safer than running everything as root.
    Code:
    gksu nautilus

  9. #9
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Can't change file permissions from root as owner

    The basic format is

    mount /dev/sdxy /mount_point -o uid=1000,gid=100,umask=007

    uid = user
    gid = group
    umask = set permissions

    The "tick" is umask if the inverse of permissions , or permissions not to have.

    See this link, umask is at the bottom

    http://www.comptechdoc.org/os/linux/..._ugfilesp.html
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Tags for this Thread

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
  •