Warning: Identity file /home/xx/.ssh/xx not accessible: No such file or directory

enter image description hereI have a V-Server on which I log in with SSH-KEY. But as soon as I remove the private key from the .ssh folder I get a warning but I can still authenticate. How is this possible


Not sure what you’re trying to do here, but to stop a user from logging in via SSH public key, remove the public key from ~/.ssh/authorized_keys.

The private keys under ~/.ssh/ are used to establish new SSH sessions from the machine itself to other targets, so even if you remove the private key from there, all it does is stop you from SSHing on that virtual machine, not logging in to it.