5

Hi can I make in linux any future file created in some directory, writable.

Thank you

gidi

2
  • 1
    Did you consider using ACLs?
    – Khaled
    Jan 21, 2011 at 12:14
  • I'm not the admin so, it sounds too big step for this aim
    – gidireich
    Jan 21, 2011 at 12:31

2 Answers 2

2

Use umask. For instance :

umask 0000

Will make files created afterwards (ie, in the same session) have the rw permissions for everyone :

-rw-rw-rw-

Should you want to make that change persistant, just place it into ~/.bashrc (assuming your shell is bash).

umask works by bit-masking the default permissions used on file creation, check its man page for more details.

2
  • Thanks. How can I set this for a single specific directory?
    – gidireich
    Jan 21, 2011 at 12:07
  • Short answer : you can't, umask works on a per-session basis. I had overlooked this requirement in your question. If you can't use ACLs, I guess you could hack something into your user's .bashrc to set the umask only when in this specific directory. Jan 21, 2011 at 14:02
2

You may also use the setuid-bit on a directory to force all created files to a specific group.

See: http://en.wikipedia.org/wiki/Setuid#setuid_and_setgid_on_directories

1
  • This is nice, but will not do the trick
    – gidireich
    Jan 21, 2011 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .