I have a ssh key without a password to login to a remote system. Let's assume the remote server is called server-name
and has the same user as the one I'm currently logged in. In the console if I do the following:
ssh server-name
A popup appears which asks me to enter my password. If I do not enter any password I get the error message Permission denied (publickey).
However, doing this:
ssh -i ~/.ssh/my_key_rsa server-name
works fine.
I also found on the net, that adding AskPassGUI no
to ~/.ssh/config
prevents the popup from being shown. However, then I get the following:
Tom@computer:~/.ssh$ ssh server-name
Enter passphrase for key '/Users/Tom/.ssh/my_key_rsa.pub':
Permission denied (publickey).
So, what do I have to do in order to login without the -i
option?
Note: I set the correct key files in ~/.ssh/config
for accessing the corresponding remote machine, i.e.
Tom@computer:~/.ssh$ cat ~/.ssh/config
AskPassGUI no
Host *
IdentityFile ~/.ssh/my_key_rsa.pub
IdentityFile
, not the public one.