How to change file owner in AIX?

27,316

You need to run chown as root.

Root means root: the user with user ID 0. If this rootuser is a user who has the permission to run commands as root by using sudo, that's not good enough. What rootuser can do is to run sudo chown … — the chown command must be run by root, the rootuser itself has no particular privileges.

Share:
27,316

Related videos on Youtube

jrara
Author by

jrara

Updated on September 18, 2022

Comments

  • jrara
    jrara almost 2 years

    How can I change a owner of a file in AIX? I created a file using my personal account and then I tried to change user for this file:

    chown rootuser myfile.csv
    chown: myfile.csv: Operation not permitted.
    

    Then I changed to root user

    sudo /usr/bin/su - rootuser
    

    and tried to change the owner of this file

    chown rootuser myfile.csv
    chown: myfile.csv: Not owner
    

    How can I change the owner of this file?

    • Jeff Hewitt
      Jeff Hewitt almost 11 years
      You are not allowed to change the ownership of any file you own to another user: this opens up a can of worms in terms of security. As for root not being able to do that, this is really strange. By any chance, are you in a corporate environment where you authenticate with something like NIS/LDAP? Is this file local to your box or is it from a network-shared partition? What is the file Bill_Item_Tag_data.csv? Is myfile.csv a symbolic link?
    • dchirikov
      dchirikov almost 11 years
      Could you add some outputs to your question? <pre>id rootuser</pre> and <pre>lsuser rootuser</pre>.
    • jrara
      jrara almost 11 years
      @JosephR I edited my question.
    • Erik Aronesty
      Erik Aronesty about 9 years
      try sudo chown rootuser myfile.csv
  • jrara
    jrara almost 11 years
    Ok, I guess my rootuser is not really a root. Thanks a lot.