ကြ်န္ေတာ္တုိ႔ hacking ပုိင္းကုိေလ့လာတဲ့အခါ Linux Command
ေတြကုိေမ့ထားလုိ႔ရပါဘူး။ လူသုံးမ်ားတဲ့ BT/Kali ဆုိတာေတြက Linux-based
ျဖစ္ပါတယ္။ Linux ကုိတကယ့္ pro အဆင့္မဟုတ္ရင္ေတာင္ basic command
ေလာက္ေတာ့သိထားသင့္တာေပါ့ဗ်ာ။ ဟုတ္မလားမသိဘူး။
အုိခီ ကြ်န္ေတာ္ကေတာ့ chmod commad အေၾကာင္း
ေတြ႕မိသေလာက္ျပန္ရွယ္လုိက္ပါတယ္။ chmod ဆုိတာကေတာ့ linux မွာ
file/directory ေတြကုိ read/write/execue လုပ္ေပးႏုိင္တဲ့ command
တစ္ခုပါပဲ။ ဘရားသားတုိ႔ shell မွာ deface တင္ရင္ 755 လားမသိဘူး။ အရင္
command ေပးရတာ သိမွာပါ။
Why we need to change permissions of a file/directory?
ရွင္းပါတယ္။
-script ေတြကုိ execute လုပ္ႏုိင္ဖုိ႔၊
-program ေတြကုိမွန္မွန္ကန္ကန္ အလုပ္လုပ္ႏုိင္ဖုိ႔၊
-ဖုိင္ေတြကုိ လုိအပ္ခ်က္အရ edit ျပန္လုပ္ႏုိင္ဖုိ႔၊
How can we change permissions for a file/directory?
နည္းလမ္းႏွစ္ခုရွိပါတယ္။ Numerical method ရယ္ Alpha method ရယ္ဆုိျပီး။
Numerical method မွာ အေျခခံအားျဖင့္ 3 ခုရွိပါမယ္။
4 – read ( r)
2 – write (w)
1 – execute (x)
နည္းနည္း အက်ယ္ခဲ်လုိက္ရရင္
7 = 4+2+1 (read/write/execute)
6 = 4+2 (read/write)
5 = 4+1 (read/execute)
4 = 4 (read)
3 = 2+1 (write/execute)
2 = 2 (write)
1 = 1 (execute)
ဥပမာအေနနဲ႕ ဖုိင္တစ္ခုကုိ သက္ဆုိင္ရာ နံပါတ္အလုိက္ခုလုိ permission ေျပာင္းသြားပါမယ္။
chmod 400 mydoc.txt – read by owner
chmod 040 mydoc.txt – read by group
chmod 004 mydoc.txt – read by anybody (other)
chmod 200 mydoc.txt – write by owner
chmod 020 mydoc.txt – write by group
chmod 002 mydoc.txt – write by anybody
chmod 100 mydoc.txt – execute by owner
chmod 010 mydoc.txt – execute by group
chmod 001 mydoc.txt – execute by anybody
Alpha method ကေတာ့ Windows နဲ႔ဆင္ပါတယ္။ Windows မွာဆုိ cmd ကေန rw ဘာညာေပါ့။ Linux မွာဆုိရင္
w--Write
x--eXecute
r—Read
u -- User
g -- Group
o – Others
a- all
+ Add specified permissions to the mention user/group/others/all
- Remove specified permissions from the mention user/group/others/all
= replicate the permission to other class of the group/user/others.
ဒါဆုိ အေတာ္အသင့္ သေဘာေပါက္သြားမယ္ထင္ပါတယ္။ Alpha method နဲ႔ပတ္သက္ျပီး နည္းနည္းရွင္းျပအုံးအံ့။
Example: -rw-r–r–
ပုံထဲက File Type ကေတာ့အမ်ဳိးမ်ဳိးကြဲျပားႏုိင္ပါတယ္။ .deb, .rpm
ဘာညာေပါ့။ ေနာက္က်န္တဲ့သုံးခုကေတာ့ permission ပုိင္းေတြပါ။ အုိေက
ေခါင္းရွဳပ္သြားျပီလားမသိဘူး။ ကြ်န္ေတာ္ကေတာ့ ေရးေနရင္း လည္လာသလုိပဲ။ ဟီး။
ဟုတ္ကဲ့ User မွာ permission နဲ႔ပတ္သက္ျပီး ႏွစ္ခုကြဲသြားပါမယ္။ Group,
Other (A, B ဆုိၾကပါစုိ႕) ဆုိပါေတာ့။
A=User ထဲကဖုိင္ေတြကုိ Group ေတြအလုိက္ permission ေပးႏုိင္ျခင္း။
B=User ထဲကဖုိင္ေတြကုိ အျခားေသာ user ေတြကုိ permission ေပးႏုိင္ျခင္း။
-rw-r–r– ရဲ႕ permission ေတြကေတာ့ ေအာက္လုိျဖစ္ပါတယ္။
-rw-r–r–
rw- For the owner
r– For the group where user belongs
r– For all other users
Numerical method ကုိျပန္သြားျပီး နိဂုံးခ်ဳပ္အေနနဲ႔ 755 chmod ကုိျပန္ၾကည့္လုိက္ရင္ ခုလုိျဖစ္မွာပါ။
read, write and execute permissions to user =7
read and execute permissions to group =5
read and execute permissions to others=5
ေပါင္းလုိက္ေတာ့ 755 ေပါ့။ ဒါဆုိရင္ ဘာျဖစ္လုိ႔ 755 command ေပးရသလဲဆုိတာ သိေလာက္ပါျပီ။
Ref: http://www.linuxnix.com/
ကြ်န္ေတာ္ Forum မွာတင္ထားတာေလးကုိ ျပန္ရွယ္ေပးလုိက္တာပါ။
11/10/2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
If you good, i don't bad. if you think you can bark me, I think i can also fuck you. I'm just ordinary person. Is that OK? :)