Aku heran apsal laa setiap kali when i was posting my blog, i cant read on the specific posting, bile aku click jerk kat link posting satu2 title tu mesti jadi access forbiden, padahal aku dah change mod untuk directory blog tu kepada read and execute.. suddenly then i remember that i should set the default protection to the newly created directories n files.

So bagi sapa2 yang hosting their blog at any freeshell account based on unix like os.. make sure that u set it early. To set the default protection for the newly created directories n files, use umask command, please make sure u know whereis ur .profile file under what kind of shell u were using, if u are bash user, then ur file could be “.bash_profile” or “.profile”

Instruction :
1. Using ur favorite editor open the file .bash_profile, e.g : vi $HOME/.profile
2. Then add this line ” umask 022″ to ur “.profile” file, then save exit ur editor

Now ur newly created directories n files will be set to the 755 mode, that means it is readable and executeable.

Additional info about umask octal number and permission
___________________________
400 – read by owner
200 – write by owner
100 – execute by owner
040 – read by group
020 – write by group
010 – execute by group
004 – read by others
002 – write by others
001 – execute by others
___________________________
By default, most shells set the umask to 022, (tp bergantung gak pada system administrator die laa) giving u write n read permissions, n others read permissions on new directories n files. To determine what the current umask setting is, run the umask command at the shell prompt, e.g : umask

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)