MacOS SSH connect using key I'm trying to connect to my host using SSH key. I've generated a key pair and added public key to authorized keys to the server.

However I'm unable to connect to server using my private key. Every time I connect it asks for the password.

I've tried to run ssh-add my_key_name and it said that it's fine and been added. But it is not working.

Also I've tried to add to my config 

Host alias
    HostName host
    User user_name
    IdentityFile ~/.ssh/id_rsa


It also is not working. ssh alias working but still asks for password.
To connect using SSH keys you need to copy the key from your machine to the remote server using ssh-copy-id user@remote_ip_address.

You will be asked to enter the password for the remote server and the key will be copied.

If you generated a key pair using a password then you will always have to enter that password when connecting. If not, you can simply connect using ssh user@remote_ip_address and you will be connected to the remote machine.