문제

How can I set the umask to make new directories with set-group-id flag as defaulte?

(I use bash on CentOs6)

I try: umask 5022

bash: umask: 5022: octal number out of range

Or: umask 05022

bash: umask: 05022: octal number out of range

Or: umask u=rwx,g=srx,o=rx

bash: umask: `s': invalid symbolic mode character

The last option is bad because we want the setgid only for directories.

도움이 되었습니까?

해결책

I don't believe you can.

However, once set, the bits are not normally cleared except by another invocation of chmod.

And once set, newly created directories inherit those bits.

Once set, one still has to go through all current directories and set the flag - it's only newly created ones that will auto-inherit.

So, find . -type d -exec chmod g+s {} \;

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top