Changing file and folder ownership from root?

6,150

What messages did you get, any errors? Did you try without the last slash in /srv/ so that it specifically indicates the directory itself?

As simple test confirms it works my side, however I did not specify a group:

root@server [/]# chown -R user1: /srv/

Perhaps there is no group called 'user1' in your case? run groups | grep user1 and see if you have that user group.

Share:
6,150

Related videos on Youtube

siliconpi
Author by

siliconpi

Updated on September 17, 2022

Comments

  • siliconpi
    siliconpi over 1 year

    I created a folder structure as root and now need to transfer ownership to an ordinary user.

    This question is linked to this one - Providing permission to specific user to access NFS share

    I have a folder /srv/app-share that needs to be visible/writeable to user1

    I tried (as root):

    root@server [/]# chown -R user1:user1 /srv/
    

    But that did not work.

  • siliconpi
    siliconpi over 13 years
    Interesting - you were right that there is no group as user1, but even using your command, as user1, I'm still not able to see/navigate to /srv
  • invert
    invert over 13 years
    what does ls -a /srv/ show you? I get an empty dir . ..
  • siliconpi
    siliconpi over 13 years
    It was created by root, and the root can navigate to it. But after chown-ing it, it's not visible for user1 (/srv)
  • siliconpi
    siliconpi over 13 years
    umm - just for clarification, it wasnt visible before to user1 either...
  • invert
    invert over 13 years
    I think you are trying to set the directory owner on a machine that does not exist on that machine. Why not map the share into user1's /home, so that the share and all files fall under user1 implicitly?