Change default UMASK

Ask a Question related to Ubuntu, Design and Development.

  1. #1

    Default Change default UMASK

    I have tried to change the default umask settings in several different
    places with no success.

    What I want to do is create a folder that different users can use to put
    shared documents in. The problem I am having is when user #1 creates a
    document it is read only for the group and if user #2 opens it, it is
    read only. How do I change it so that by default when a user creates a
    document someone else in the same group can open the file for read write.

    I assume I have to change the default umask to get this to work but
    everything I have tried leaves the umask 022.

    Can someone tell me the proper way to get this going.

    Ian
    Ian Guest

  2. Similar Questions and Discussions

    1. How to change default Acrobat application ?
      To test the Acrobat plugin I'm developing, I have installed several Acrobat versions in parallel: 5, 6, 7, and 8 - version 9 coming soon. How can...
    2. Can I change default link behavior in 3.1?
      Is it possible to change the default behavior in Contribute (3.x) so that when a user creates a link, it defaults to " target='_blank' " ? Thanks,...
    3. Change the default browser
      Can the default browser in Contribute be changed? I want to use Firefox or Mozilla instead of IE. I see no option for changing this feature in the...
    4. Default save location/How to change???
      Having a probelm trying to create a PDF from a network location to my local computer. The software I am in is a image/database software package...
    5. Change Default folder location
      How do you change the default folder location in Reader 6? When I Change the location save and exit it does not stay with the folder that I selected....
  3. #2

    Default Re: Change default UMASK

    Ian wrote:
    > I have tried to change the default umask settings in several different
    > places with no success.
    >
    > What I want to do is create a folder that different users can use to put
    > shared documents in. The problem I am having is when user #1 creates a
    > document it is read only for the group and if user #2 opens it, it is
    > read only. How do I change it so that by default when a user creates a
    > document someone else in the same group can open the file for read write.
    >
    > I assume I have to change the default umask to get this to work but
    > everything I have tried leaves the umask 022.
    >
    > Can someone tell me the proper way to get this going.
    Change the sticky bit for the group on the directories you need group RW on.
    No offence, but this is all explained REALLY well in the man page:

    man chmod

    Let me know if you have any questions.

    HTH,

    James
    --
    I am the mother of all things, and all things should wear a sweater.

    Centurion Guest

  4. #3

    Default Re: Change default UMASK

    Centurion wrote:
    > Ian wrote:
    >
    >> I have tried to change the default umask settings in several different
    >> places with no success.
    >>
    >> What I want to do is create a folder that different users can use to put
    >> shared documents in. The problem I am having is when user #1 creates a
    >> document it is read only for the group and if user #2 opens it, it is
    >> read only. How do I change it so that by default when a user creates a
    >> document someone else in the same group can open the file for read write.
    >>
    >> I assume I have to change the default umask to get this to work but
    >> everything I have tried leaves the umask 022.
    >>
    >> Can someone tell me the proper way to get this going.
    >
    > Change the sticky bit for the group on the directories you need group RW on.
    > No offence, but this is all explained REALLY well in the man page:
    >
    > man chmod
    >
    > Let me know if you have any questions.
    >
    > HTH,
    >
    > James
    No offense taken. From the man chmod I copied this
    > When the sticky bit is set on a directory, files in that directory may
    > be unlinked or renamed only by root or their owner. Without the sticky
    > bit, anyone able to write to the directory can delete or rename files.
    > The sticky bit is commonly found on directories, such as /tmp, that are
    > world-writable.
    Seems the sticky bit it only prevents users deleting or renaming files.

    If you meant set the group ID bit that doesn't solve my problem either.
    Yes the users have rw access to the folder, but my problem is, if user
    number one fires up open office and creates a new document and saves it
    to the folder it is saved with rwx r-- r-- permissions no matter how I
    set permissions on the folder. So if user number two opens the document
    he can't edit it. He can make a copy of it and edit the the copy, but
    can't edit the original.

    It's a pain if the document creator has to go back in and change the
    permissions to rwx rw- r-- every time he creates a document.

    I think I need to change the default creation mask from 022 to 002. I
    just can't seem to find the right place to make the change stick.

    Ian
    Ian Guest

  5. #4

    Default Re: Change default UMASK

    Ian wrote:
    > Centurion wrote:
    >> Ian wrote:
    >>
    >>> I have tried to change the default umask settings in several different
    >>> places with no success.
    >>>
    >>> What I want to do is create a folder that different users can use to put
    >>> shared documents in. The problem I am having is when user #1 creates a
    >>> document it is read only for the group and if user #2 opens it, it is
    >>> read only. How do I change it so that by default when a user creates a
    >>> document someone else in the same group can open the file for read
    >>> write.
    >>>
    >>> I assume I have to change the default umask to get this to work but
    >>> everything I have tried leaves the umask 022.
    >>>
    >>> Can someone tell me the proper way to get this going.
    >>
    >> Change the sticky bit for the group on the directories you need group RW
    >> on. No offence, but this is all explained REALLY well in the man page:
    >>
    >> man chmod
    >>
    >> Let me know if you have any questions.
    >>
    >> HTH,
    >>
    >> James
    >
    > No offense taken. From the man chmod I copied this
    >
    >> When the sticky bit is set on a directory, files in that directory may
    >> be unlinked or renamed only by root or their owner. Without the
    >> sticky
    >> bit, anyone able to write to the directory can delete or rename
    >> files. The sticky bit is commonly found on directories, such as
    >> /tmp, that are world-writable.
    >
    > Seems the sticky bit it only prevents users deleting or renaming files.
    >
    > If you meant set the group ID bit that doesn't solve my problem either.
    > Yes the users have rw access to the folder, but my problem is, if user
    > number one fires up open office and creates a new document and saves it
    > to the folder it is saved with rwx r-- r-- permissions no matter how I
    > set permissions on the folder. So if user number two opens the document
    > he can't edit it. He can make a copy of it and edit the the copy, but
    > can't edit the original.
    >
    > It's a pain if the document creator has to go back in and change the
    > permissions to rwx rw- r-- every time he creates a document.
    >
    > I think I need to change the default creation mask from 022 to 002. I
    > just can't seem to find the right place to make the change stick.
    Ah - I see what you're trying to do. Apologies - I read your first post
    rather quickly...my bad.

    /etc/login.defs is the magic you're after :) Read the comments in there
    though as it may not be the best solution for your situation.

    If your users enter the system from various points (login, ssh, gdm, etc)
    you may want to use the "libpam-umask" package instead:

    This PAM module sets the umask for successfully authenticated sessions.
    The umask affects the permissions assigned to newly created files by
    default.

    This package is useful to ensure that users' umasks are set consistently
    whether their session is initiated by login, SSH, a display manager for
    the X Window System, or some other means.

    Sorry about the confusion earlier :)

    Cheers,

    James
    --
    Just because he's dead is no reason to lay off work.

    Centurion Guest

  6. #5

    Default Re: Change default UMASK

    Centurion wrote:
    > Ian wrote:
    >
    >> Centurion wrote:
    >>> Ian wrote:
    >>>
    >>>> I have tried to change the default umask settings in several different
    >>>> places with no success.
    >>>>
    >>>> What I want to do is create a folder that different users can use to put
    >>>> shared documents in. The problem I am having is when user #1 creates a
    >>>> document it is read only for the group and if user #2 opens it, it is
    >>>> read only. How do I change it so that by default when a user creates a
    >>>> document someone else in the same group can open the file for read
    >>>> write.
    >>>>
    >>>> I assume I have to change the default umask to get this to work but
    >>>> everything I have tried leaves the umask 022.
    >>>>
    >>>> Can someone tell me the proper way to get this going.
    >>> Change the sticky bit for the group on the directories you need group RW
    >>> on. No offence, but this is all explained REALLY well in the man page:
    >>>
    >>> man chmod
    >>>
    >>> Let me know if you have any questions.
    >>>
    >>> HTH,
    >>>
    >>> James
    >> No offense taken. From the man chmod I copied this
    >>
    >>> When the sticky bit is set on a directory, files in that directory may
    >>> be unlinked or renamed only by root or their owner. Without the
    >>> sticky
    >>> bit, anyone able to write to the directory can delete or rename
    >>> files. The sticky bit is commonly found on directories, such as
    >>> /tmp, that are world-writable.
    >> Seems the sticky bit it only prevents users deleting or renaming files.
    >>
    >> If you meant set the group ID bit that doesn't solve my problem either.
    >> Yes the users have rw access to the folder, but my problem is, if user
    >> number one fires up open office and creates a new document and saves it
    >> to the folder it is saved with rwx r-- r-- permissions no matter how I
    >> set permissions on the folder. So if user number two opens the document
    >> he can't edit it. He can make a copy of it and edit the the copy, but
    >> can't edit the original.
    >>
    >> It's a pain if the document creator has to go back in and change the
    >> permissions to rwx rw- r-- every time he creates a document.
    >>
    >> I think I need to change the default creation mask from 022 to 002. I
    >> just can't seem to find the right place to make the change stick.
    >
    > Ah - I see what you're trying to do. Apologies - I read your first post
    > rather quickly...my bad.
    >
    > /etc/login.defs is the magic you're after :) Read the comments in there
    > though as it may not be the best solution for your situation.
    >
    > If your users enter the system from various points (login, ssh, gdm, etc)
    > you may want to use the "libpam-umask" package instead:
    >
    > This PAM module sets the umask for successfully authenticated sessions.
    > The umask affects the permissions assigned to newly created files by
    > default.
    >
    > This package is useful to ensure that users' umasks are set consistently
    > whether their session is initiated by login, SSH, a display manager for
    > the X Window System, or some other means.
    >
    > Sorry about the confusion earlier :)
    >
    > Cheers,
    >
    > James
    That is exactly what I'm looking for, I'll give it a try

    Thanks again

    Ian
    Ian Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139