If you can proceed to a ssh as root without entering a password ( host source to host destination) it means that you have correctly done the ssh copy
Question:
did you copty the whole content fo /root/.ssh/id_rsa into ambari ui
did you create your rsa key as the root user? if not you won’t be able to use root in ambari ui for the installation process.