Here I have used Python Paramiko as my preferred approach. There have been several articles discussing how to use Paramiko but I am more focused in using it for network scripting. After reading these articles, I have managed to create a working script and uploaded in my github repository (netscript). Kindly note that this a work in progress.
To get this script working, you need to install Python and Paramiko on Linux (preferred). Check with your preferred Linux distribution in installing these. In my environment which is Debian Linux, these are installed with apt-get.