Elasticsearch configuration on the fly

This is a general configuration question.

I have a production cluster of 3 master and 3 data node. I want to enable dynamic scripting [off by default].

Do i have to individually change the 6 configuration files on the 6 nodes and do a rolling restart ? Or is there any other way to achieve this.

Yes, for non-dynamic settings you will need to make the change to elasticsearch.yml and then perform a rolling restart.

This is a requirement in particular for this security-sensitive setting so that any potential attacker cannot just turn scripts on and then try to exploit Elasticsearch with scripting.