简体   繁体   中英

Why I can do ssh to my server using any private key?

I have private/public key authentication for connection to my server, after connecting to my server using my correct private key I can authenticate to my server using any private key file and it works

I use -i option for specifying the private key: ssh -i /anything meliwex@server_ip

Even if the file doesn't exist I can still connect to my server联系

Is it possible that ssh caches the private key? If yes how can I remove that cache?

You could add -v to see which keys are really used.

The -i option isn't exclusive, ssh is still able to use keys from a ssh-agent and also the default keys from .ssh/id_*

Probably your key in .ssh/id_rsa isn't protected with a passphrase.
Therefore ssh will use it silently and you can login.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM