Mac OS X: Delete SSH Keys Using Terminal Command Line

Posted on in Categories , , last updated November 18, 2013

I have aws.sg.pub and ibm.sl.pub file for ssh login. How do I delete ssh key file called ~/.ssh/aws.sg.pub 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

OR

rm $HOME/.ssh/file.pub

OR

rm ~/.ssh/file.pub

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

rm ~/.ssh/aws.sg.pub

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+.

Leave a Comment