Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi, I had set read, write and execute permission to a directory using the command chmod -R 777 myfilename this made that directory and its sub directory read, write and ...
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    26

    how to set write permission

    Hi,
    I had set read, write and execute permission to a directory using the command
    chmod -R 777 myfilename

    this made that directory and its sub directory read, write and executable, but if i create a new directory inside that directory it dont have the same set if permission as the parent...what is the solution for this..

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    change the ownership of parent dirctory.
    Code:
    chown -R <user_name>:<group_name> <directory>




    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Jan 2007
    Posts
    26
    I checked its not working..
    for the command
    chmod +R nobody:nobody /root/Desktop/backup/
    this is the result
    chmod: invalid mode string: `+R'

    whats wrong...is there any other way?

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    its - not +.
    Code:
    chown -R nobody:nobody /root/Desktop/backup/





    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    Hey, it is not
    chmod - Use chown
    there is a mistake in what u have used...

    It is "chown" and not "chmod" [suggested by Casper]
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    ooops ! i didn't look into that. its -R and 'chown'. thanx cyberinstru.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Jan 2007
    Posts
    26
    chown -R nobody:nobody /root/Desktop/backup/

    changed the owner of the directories but still if i create a directory inside it..the new directory is not having same set of permission like its parent

  8. #8
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    Once you set the ownership for the directory (you do this as root or as a sudoer), log on as that user and try creating files or directories. That should work. But if you create the files/directories with root privileges, then the ownership will be root....

    Please let us know, if ur problem is not understood correctly.
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  9. #9
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    The issue with this is what is called the umask. The umask determines the default permissions for anything you create.

    If you run the command 'umask' from a terminal, you will see your current umask. These are subtracted from the system-default permissions (666 for files, 777 for directories).

    So you cannot change the default permissions for only directories, but you can change your overall permission changing.

    So for instance, if my umask is 0022, I create directories with permissions 755 (rwxr-xr-x) and files with permissions 644 (rw-r--r--).

    You can change your umask by using the umask command. See the man page for more info.
    DISTRO=Arch
    Registered Linux User #388732

  10. #10
    Just Joined!
    Join Date
    Jan 2007
    Posts
    26
    Thanx for the replies..yes i created the directories as root, now i tried it as another user it is working ...

Page 1 of 2 1 2 LastLast

Posting Permissions

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