{"id":4048,"date":"2014-12-03T00:11:05","date_gmt":"2014-12-02T16:11:05","guid":{"rendered":"http:\/\/rmohan.com\/?p=4048"},"modified":"2014-12-03T00:11:05","modified_gmt":"2014-12-02T16:11:05","slug":"setup-umask","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4048","title":{"rendered":"Setup Umask"},"content":{"rendered":"<p>The default umask for Solaris 10 and Ubuntu normal useris 0022, however default umask for CentOS normal user account is 0002.<br \/>\nHence default directory permissions are 775 and file permission are 664.<\/p>\n<p>The umask creation of new executable file is calculated as follows:<\/p>\n<p>Default permissions 777<br \/>\nsubtract umask value 022<br \/>\nAllowed permissions 755<\/p>\n<p>The umask creation of new text file is calculated as follows:<br \/>\nDefault permissions 666<br \/>\nsubtract umask value 022<br \/>\nAllowed permissions 644<\/p>\n<p>To harden system, umask 027 is always suggested.<\/p>\n<p>Umask value, User, Group, Others<br \/>\n0027 , all , r\/w , none<\/p>\n<p><strong>Location to configure default umask<\/strong><br \/>\n<strong>CentOS:<\/strong><\/p>\n<p>Default System wide umask can be setup in \u201c<strong>\/etc\/bashrc<\/strong>\u201c, \u201c<strong>\/etc\/<span class=\"skimlinks-unlinked\">csh.cshrc<\/span><\/strong>\u201c<\/p>\n<p>Default Users umask can be changed in \u201c<strong>~\/.bash_profile<\/strong>\u201c<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Ubuntu:<\/strong><\/p>\n<p>Default System wide umask can be setup in \u201c<strong>\/etc\/profile<\/strong>\u201c, \u201c<strong>\/etc\/<span class=\"skimlinks-unlinked\">login.defs<\/span><\/strong>\u201d and \u201c<strong>\/etc\/skel\/.profile<\/strong>\u201c<\/p>\n<p>Default Users umask can be changed in \u201c<strong>~\/.bash_profile<\/strong>\u201c<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Solaris:<\/strong><\/p>\n<p>Default System wide umask can be setup in \u201c<strong>\/etc\/profile<\/strong>\u201c, \u201c\/<strong>etc\/.login<\/strong>\u201c,\u201d<strong>\/etc\/skel\/<span class=\"skimlinks-unlinked\">local.cshrc<\/span><\/strong>\u201c,\u201d<strong>\/etc\/skel\/local.profile<\/strong>\u201d and \u201c<strong>\/etc\/skel\/<span class=\"skimlinks-unlinked\">local.login<\/span><\/strong>\u201c<\/p>\n<p>Default Users umask can be changed in \u201c<strong>~\/<span class=\"skimlinks-unlinked\">local.cshrc<\/span><\/strong>\u201c<a href=\"https:\/\/linuxreference.files.wordpress.com\/2010\/11\/linux_icon.gif\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default umask for Solaris 10 and Ubuntu normal useris 0022, however default umask for CentOS normal user account is 0002. Hence default directory permissions are 775 and file permission are 664.<\/p>\n<p>The umask creation of new executable file is calculated as follows:<\/p>\n<p>Default permissions 777 subtract umask value 022 Allowed permissions 755<\/p>\n<p>The umask [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4,17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4048"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4048"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions"}],"predecessor-version":[{"id":4049,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4048\/revisions\/4049"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}