Find the answer to your Linux question:
Results 1 to 10 of 10
umask is used to se a default permission for creating files. Is there something like this to set the default ownership for any new file?...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    20

    Is there a mask for ownership like umask?

    umask is used to se a default permission for creating files.
    Is there something like this to set the default ownership for any new file?

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    No .

  3. #3
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    suppose that there is a default ownership and it says every new file is defaulted to root.
    if a user(who does not have root access ) creates a file and forgets to set the ownership to him/herself then that file is lost as he/she cant get it back without root access.
    Linux and me it's a love story

  4. #4
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    It's not a mask, but you can predict who the owner and controlling group will be, and can use umask to set the permissions of the controlling group.

    The owner of a newly-created file is the creator, obviously, but the group is the primary group as specified in /etc/passwd. The fourth field for a user in /etc/passwd is the GID of his primary group. Knowing this, you could change the primary group to what you want, and use umask to give it the permissions you desire.

    Hope this helps.
    DISTRO=Arch
    Registered Linux User #388732

  5. #5
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    Linux is based on Discretionary Access Control (DAC).

    I think what you are looking for is Mandatory Access Control (MAC)

    I believe that there are some security enhancing applications that can add MAC controls ... that may solve your problem.



    Men occasionally stumble over the truth,
    but most of them pick themselves up
    and hurry off as if nothing had happened.

    Winston Churchill


    ... then the Unix-Gods created "man" ...

  6. #6
    Just Joined!
    Join Date
    Apr 2008
    Posts
    20
    Quote Originally Posted by khafa View Post
    suppose that there is a default ownership and it says every new file is defaulted to root.
    if a user(who does not have root access ) creates a file and forgets to set the ownership to him/herself then that file is lost as he/she cant get it back without root access.
    Actually I need the opposite.
    I always login into root, but when I create/extract/manage My clients files, he can't access it or modify it until I change the ownership of all what I done.

    Thanks for all, I'll continue using chown

  7. #7
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I'm sure you already know this, but just in case you don't:

    If you're doing things by hand (as opposed to a script which automates things), then chown's -R switch could be very useful.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  8. #8
    Just Joined!
    Join Date
    Apr 2008
    Posts
    20
    Quote Originally Posted by wje_lf View Post
    I'm sure you already know this, but just in case you don't:

    If you're doing things by hand (as opposed to a script which automates things), then chown's -R switch could be very useful.
    Yes it is, but not on a folder have a thousands of files and sub folders

  9. #9
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Quote Originally Posted by kdman View Post
    Yes it is, but not on a folder have a thousands of files and sub folders
    Actually that's exactly what that command is for. The -R switch is for recursive which means it will act on all files and subfolders to those specified to the command.

  10. #10
    Just Joined!
    Join Date
    Apr 2008
    Posts
    20
    Quote Originally Posted by bigtomrodney View Post
    Actually that's exactly what that command is for. The -R switch is for recursive which means it will act on all files and subfolders to those specified to the command.
    Yes, but when you execute it on 500,000 file, you must wait about 15 minute with a very very high server load.
    So I just execute it on the files that i created.

Posting Permissions

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