0

I am setting default umask of linux box for the first time. I log in as root user on a Centos 6 server. I want these default values:

owner:  read/execute/write (7)
group:  read/execute (5)
other:  read (4)

To get umask value, I deduct targets from 777: 777-754 = 023

# umask 023

then do a double check

# umask -S
  u=rwx,g=rx,o=r

then create and display file permissions

# echo x > testfile.txt
# ll | grep testfile.txt
  -rw-r--r--.  1 root   root           4 Jun 26 01:15 testfile.txt

which is not quite what I was expecting.

0

1 Answer 1

0

umask filters the permissions requested by the application which is commonly 666 for regular files.

Because shells will not set file execute bit by default, as a security precaution, you always have to set it manually when required.

1
  • thanks for answer!! I read this elsewhere but I did not see link to my problem.
    – user747
    Jun 26, 2016 at 17:36

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