Find the answer to your Linux question:
Results 1 to 5 of 5
Alright so here's the question and I kind of need an answer pretty quickly (my boss is waiting hehe). Is there a way to change permssions on a directory and ...
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    11

    Permissions on a single user



    Alright so here's the question and I kind of need an answer pretty quickly (my boss is waiting hehe). Is there a way to change permssions on a directory and all its files and subdirectories (-R?) to a specific user? I'm logged in as root.

    Ex: I have a directory called dir1 and a user named mike. How do I give read permission to mike on dir1 and all of its subdirectories and files.

    Plz help!

  2. #2
    Just Joined!
    Join Date
    Nov 2004
    Location
    Perth, Western Australia
    Posts
    59
    if you want to make him the owner of the folder and its contents, do
    Code:
    chown -R mike dir1/
    chmod -R u+r dir1/
    if you don't, you'll have to put him in a group and set the folder and it's contents to that group.
    im pretty sure that by default, when you create a user, it creates a group with the same name with only that user in it, so if you want to use this group, you could do:
    Code:
    chown -R :mike dir1/
    chmod -R g+r dir1/
    sorry if this post is too late to help, my clocks are all different times, so I don't know what the time is.

    EDIT: ok it looks like im over an hour too late...

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    11
    Can you explain that a little better. I'm a Unix and Linux nub. I don't want to make him the owner of the directory. He is only a temporary person and will be deleted in 2 weeks. I want to tkeep things as simple as possible. What is the default group when you first create a user? How can I change a user's group? How do I assign permssions to a certain group while being logged into root?

    Can someone please answer this. I need an answer quick.

  4. #4
    Linux Engineer rong's Avatar
    Join Date
    Feb 2005
    Location
    California
    Posts
    803
    Quote Originally Posted by mike_1984
    Can you explain that a little better. I'm a Unix and Linux nub. I don't want to make him the owner of the directory. He is only a temporary person and will be deleted in 2 weeks. I want to tkeep things as simple as possible. What is the default group when you first create a user? How can I change a user's group? How do I assign permssions to a certain group while being logged into root?

    Can someone please answer this. I need an answer quick.
    Google.com is a great source especially for multiple questions like these.

    Also right there on your box you can type
    Code:
    info chmod
    for example

    or
    Code:
    man adduser
    or useradd...i get them mixed up!
    registered Linux user #388382

    Have you checked here first?

  5. #5
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,043
    In your other (now locked, duplicate) thread, someone's reminded me that Linux supports ACLs, which should achieve your aim. man setfacl should get you started.

    Steve

Posting Permissions

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