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.

user747
  • 3
  • 1

1 Answers1

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.

Julie Pelletier
  • 1,010
  • 7
  • 8