Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Dear Group, I am creating new users with adduser command in linux and it's working fine. But whenever I copy any file as a root to the home directory of ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    8

    Problem with file permission

    Dear Group,

    I am creating new users with adduser command in linux and it's working fine. But whenever I copy any file as a root to the home directory of that user, user is unable to access that file. While accessing the files which was copied by root, it shows buffer read only. Please advice how to resolve this issue. I want to give full access to the particular user.

    Thanking you...

    ...Jay

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Make the new user the owner of the files with "chown" and change the group ownership with the "chgrp" command.
    Check the man pages of chown and chgrp.

    Regards

  3. #3
    Banned
    Join Date
    Oct 2007
    Posts
    219
    Right click on mouse, then "properties", and then "Permission", etc.

  4. #4
    Just Joined!
    Join Date
    May 2007
    Posts
    8
    Dear All,

    Thanks for your quick response. However, suggested way is not my requirement. By this way for each file which is copied by Root user need to be change manually. Can this be automated to root user need not to execute chown/chgrp command for each and every file? Please suggest.

    ...Jay

  5. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    you can use -R option to change permissions recursively.
    Code:
    chown -R <user>:<group> <folder>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #6
    Just Joined!
    Join Date
    May 2007
    Posts
    8
    Dear devils_casper,

    Thanks for your prompt reply, however, it is not solving the purpose. It is working very fine for all those files which have been copied to user's home directory but whenever I copied any new files as SU, the same problem occured. Users are getting read-only buffer.

    What I was trying, whenever su copy any files to user's home directory, that file should have read/write access to that particular user. Please suggest to eradicate this problem.

    ...Jay

  7. #7
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Can you please give us a sample of the exact command you use to copy a file in this situation?

    And if you sometimes copy more than one file in the same command in this situation, can you also please give us a sample of the exact command you use to copy these files?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  8. #8
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    You've got to cp -a that file. -p would work for permissions, but I think it won't preserve selinux context, which is normally what you want to do.

  9. #9
    Just Joined!
    Join Date
    May 2007
    Posts
    8
    Dear wje_lf,

    I am copying file from window share through samba (as su). For example I have created a new user say abc

    Whenever, I am copying a file as su to /home/abc directory, user abc is getting read-only buffer.

    I hope I made it clear.

    Thx,
    ...Jay

  10. #10
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Whenever, I am copying a file as su to /home/abc directory
    Can you post one of the commands that you use to copy? Please don't describe the command, just post the exact command.
    --
    Bill

    Old age and treachery will overcome youth and skill.

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
  •  
...