I'm using Mac OS and can succesfully connect via terminal and ssh to the host with the command
ssh -i ~/full/path/to/private_key name@ip
But when I try to use the exact same command in Visual Studio Code using Remote-SSH "Connect to Host", it returns me "Could not establish connection to "ip": Permission denied (publickey)".
How to fix it? I've tried to add my local public key to the authorized_keys on host, but it didn't help.