If you want to connect to remote server from your local without using passwords do the following steps:
Generate the ssh keys on your local using ssh-keygen .
Copy the generated pubic key (by default id_rsa.pub, if you ran ssh-keygen without any options) and place it in the ~U/.ssh/authorized_keys of your remote. I am not sure how to use ssh-copy-id , but you can try using the below code(run it from your local):