I have two Ubuntu server and run a bash script over cron as root. When I wont to copy the result from server1 to server2, I have the problem that I get prompted for the root password. First problem, the script should run without interaction, second I cannot create a ssh key for root because Ubuntu has no root user. Any suggestions?

  • Ubuntu does have a root user - albeit one whose password is locked by default. There should be nothing stopping you from setting up key-based authentication for root - you will just need to use sudo to copy the public key to the target server's /root/.ssh/authorized_keys file (or - temporarily - enable password-based root login to do so). – steeldriver Mar 6 '18 at 16:31
  • These are two separate questions and you should be able to find the solution or at least something to try in askubuntu. Try askubuntu.com/questions/72267/… and askubuntu.com/questions/46930/… – Katu Mar 6 '18 at 16:53

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.