I have already setup the password-less login to localhost via ssh, and it works.
justinwu@ubuntu:~$ ssh root@localhost Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-110-generic x86_64) * Documentation: https://help.ubuntu.com/ 2 packages can be updated. 0 updates are security updates. New release '16.04.2 LTS' available. Run 'do-release-upgrade' to upgrade to it. Last login: Tue Mar 7 10:08:22 2017 from localhost
But while running one script and it needs to login as root via ssh, it returned the error 'Permission denied (publickey)'.
Starting tests: Tue Mar 7 10:08:28 2017 Launching 20 processes. Starting test client: 0 Host: localhost Workload: VDI Workdir: /mnt/share Permission denied (publickey).
It should work, but not sure why it's denied.