If the key is not named id_rsa it does not work
Solution 1:
Arronical's answer is good for a one-time connection, but would be painful in the long term. In order to make ssh
always use this key when connecting to this server, you can add this to your ~/.ssh/config
(or create it if it does not exist):
Host vps718449.ovh.net
IdentityFile ~/.ssh/id_rsa_admin
Then you can connect with just ssh [email protected] -p 9215
. As an added bonus you can also configure the port:
Host vps718449.ovh.net
IdentityFile ~/.ssh/id_rsa_admin
Port 9215
Then you can connect with just ssh [email protected]
. Even further:
Host vps718449.ovh.net vps
Hostname vps718449.ovh.net
User admin
IdentityFile ~/.ssh/id_rsa_admin
Port 9215
Then just ssh vps
will work! Of course vps
is just an example, you can use any other alias you want (for example if you have more than one VPS). See man ssh_config
for a list of the options you can set there.
Solution 2:
You need to use the -i
option to your ssh command using the path to your key. The modified command will be:
ssh -i ~/.ssh/id_rsa_admin [email protected] -p 9215