Mac OS X: Delete SSH Keys Using Terminal Command Line

in Categories , , last updated November 18, 2013

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) for more information.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 0 comments/add one below):