Is there a way to automatically use an ssh private key instead of a password?
Hello everyone,
I have an ssh server, and would like to access it from my Mac using the private key, rather than the password.
In terminal on my Mac, I used the ssh-keygen command to generate a key pair, then the ssh-copy-id command to upload the public key to my ssh server. I have also disabled password authentication on the server.
When I first attempted to log into my server, I received a "Permission Denied: Publickey" message. However, when I added the -i option to point to my private key, it worked perfectly. So the ssh connection with the keypair is working.
The issue is that it becomes cumbersome to type the command each time I wish to connect, as I have to specify the private key, as well as the port, as I use a non-standard one.
I'm wondering if there is a means of having Terminal automatically use that private key when connecting to this particular server? Would I be better off with a third-party terminal client? I found one called Termius on the App Store.
Any help gratefully received, cheers.
MacBook Air, macOS 13.2