Settings > Security > Developer mode -> ON
It will download some packages automatically (~2 MB) and the phone will go for an automatic reboot.
You will find the 'Terminal' icon after the restart.
To gain root privileges,
It will ask for password.
Default password: rootme
You can change the default root password anytime later using the following command.