Wednesday, October 28, 2009

Long time post....

Hi All,

[PS: Includes lot of Regular Expres?ion?...????]

I literally know that its been a very long time since I am blogging [actually I have stopped blogging.... Kidding....] Sorry many things under my belt....

But still lets keep this going when I am going... :)

This posts tells about all[not all :(] the stuff about chgrp, chown and chmod commands of *nix. These are some of the most basic ones... and of course the most common commands too...

chgrp - change the group permissions of a file/folder.
chown - change the ownership for a file/folder and of course to/for a group.
chmod - change file mode bits. [This is long to teach for a newbie to *nix. I will[try to] post one more some other day]

Better is to give 'man' command for all these 3. ??Man learns a lot of things from 'man' :) Finally if you know no man then try giving 'man man'

Ok jokes apart...

So the main reason for me to write this post is -

What if you have saved your bank a/c details in a txt file and saved it in a folder and want to save it from creapers...

Case 1: In Doors OS :D

U have a thousand lot of softwares that encrypt / secure a folder with a password.
U also have a trillion lot of people who crack these crap softwares :)

Case 2: Enter the Linux UI world

Right click on the folder where you have saved your so called stupid document [do u do it ever???]
Go to Properties->Permissions
Do this: Change the "Folder Access:" to "List files only" under your group "Owner"
[I know it bounced over your heads... If you are a user with 'xyzabc' as your username - and you have created the folder and file under your permission mode...mail me please @]

Thats it and you are done... :)

Now - why did I use the other 3 commands above - If I could do the same on a GUI....??

So its simple - if you do anything in UI - then itz common-sense that it would have worked in command line before that... :D

Case 3: Enter the konsole...

For changing group - use this - chgrp -R ananth:killer mydata

Here above - U are the user - ananth and the owner, killer is the new group already created and existing, 'mydata' is your personal folder name. -R option is for doing it recursively to all the folders under 'mydata' folder...

For changing file mode bits [man it or google it]

U use this - chmod u+r mydata - and you are doing it as 'killer'

[Flaw: ananth can still get all your bank details but cant do anything more to it. He cant change[write] your a/c number. But I know that killer is not so dumb to put his ATM 4 digit password in the txt file. :D]

I would not use chown anyways...

Problem with Case 2:[Implementing this problem in Linux... Not 'Gates' of OF-COURSE]

So you are very intelligent and you save this folder of yours in a flash drive of 128Mb[Do we still get them in the market???]
Next - you are wholly[Not a typo...] shit Linux User... And you want to do the case 2 of above.

Please - dont imagine doing it - its not at all possible for ever. [For people who have got this running - add a comment please...]

Conclusion - U cant encrypt a folder like in case 2. It is not possible - as my 128Mb drive is a Fat32 formatted one. Guys - Its mounted as rw only...

Other solutions to this problem are always welcome and I would be happy to post it... I would not want stupid answers like - format the whole flash drive into ext3 or to any other Linux FS... I would not stop laughing then.... :D Lolzzzzzzzzz

Ananth Gouri

No comments:

Post a Comment