-5

I have a folder created by root and I want to be able to add permissions to a usergroup so they can move around the files etc.

I did the following:

chgrp -R developers testdir

The file owner is now root and the group owner is developers. Why can a user in developers not make changes yet?

DD.
  • 3,024
  • 10
  • 34
  • 50
  • 7
    This is all very basic stuff which we would hope that someone working as a professional sysadmin (the target audience for the site) would know. Can I suggest that you speak to your manager about getting some basic linux education - you really need it. – user9517 May 17 '12 at 07:19
  • @Iain wow..thats really unhelpful...I cant really afford a professional sysadmin...I'm a software developer running my own startup. – DD. May 17 '12 at 07:33
  • 5
    Iain's advice may seem unhelpful, but it's not really. If you're asking questions like the one above, the skills gap between you and what you're going to need is likely so **vast** that you'd have to put a huge amount of your time into coming up to speed. If you're the main developer, there are better things to be doing with your time than training to be a mediocre sysadmin. It makes **simple business sense** to get professional help in a case like this, perhaps on a day-a-week basis. – MadHatter May 17 '12 at 07:37
  • @MadHatter lol...I had everything working fine as user root...but decided to do things the hard way http://serverfault.com/questions/378315/logging-in-as-root – DD. May 17 '12 at 07:42
  • 1
    As you point out, it's not a good idea to do everything as root, and the pain you're feeling now is part of regularising things. Good for you; I only fear there's more such pain to come. – MadHatter May 17 '12 at 07:51
  • 3
    Mother of $DEITY :) This funny – zordor May 17 '12 at 08:08
  • Also, do not forget that a logged on user that you add to "developers" will only get that group on logons AFTER having been added. Also: get somebody in now esp if your business plan involves operating services and not just selling software. People might still be willing to be very inexpensive if they have the outlook of winding up as your CIO one day - just make sure if your business delivers, so do you. You can't have a ops guy than one that has been involved in a design from the beginning anyway! – rackandboneman May 17 '12 at 14:05

2 Answers2

8

For standard unix permissions you must always consider, the owner (user/group/other), permission bits, and the umask. The combination of these things are what describe your effective rights, and the permissions of new items.

  • chown/chgrp set the ownership.
  • chmod set the permssions
  • the umask is part of each users environment and depending on how it is set, it will remove permission bits.

So if you want to create a shared folder for a group you usually need to do something like this.

  • Create a new group (projectgrp) and add the users to that group.
  • Change the group ownership of everything under your project folder to projectgrp
  • Change the permissions of all the folders to 2775
  • Change all the files to 0664.
  • Change the umask for all users to 0002

Of course there are other things you can do with ACLs that are a lot more complex for the sysadmin, but can make things easier for the end user.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
3

Because the group doesn't have suitable permissions on the files and directories on and within testdir.

user9517
  • 114,104
  • 20
  • 206
  • 289