Mac OS X: Delete SSH Keys Using Terminal Command Line

last updated in Categories , ,

I have and file for ssh login. How do I delete ssh key file called ~/.ssh/ using the terminal on Apple Mac OS X?

You can use rm command to delete the file from your local Mac based system. The syntax is:

rm fileName


rm $HOME/.ssh/


rm ~/.ssh/

In this example, delete a file called ~/.ssh/ using the rm command

rm ~/.ssh/

See rm(1) command man page for more information.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.