Well the steps are very easy & it should work on any android phone not just samsung phones.
First unpack the stock boot.img of your device.
Then open the default.prop file and set
and save the file.
Now repack the boot image and tar it.
Then you can flash it via Odin
The changes give us root access to adb shell and we can push the su binary and Superuser.apk via adb.
But if you are lazy
then run any of the available rooting tools which copy the necessary files via adb(eg Doomlord's toolkit)