After I used
rm -r ~/ to delete the temporary files inside my remote home directory, I can’t login through ssh any more. Error message:
ssh permission denied (publickey)
Lots of config files are put under user’s home directory, use
ls -a to display these invisible config files.
Public keys are put under
.ssh. By deleting all the files under home directory, I also cut down my own access to login again.
- Don’t use
rm -r ~/, it’s a very risky command. You will delete all of your keys and configs with this command. To make things worse, it’s possible to delete the
/rootwith admin permission using this command.
- Delete exact files instead, avoid –recrusive option. Or use -i to review the files to be deleted one by one.