You can also use xclip (assumes you're running a Debian based distro):
$ sudo apt-get install xclip # Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`) $ xclip -sel clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Credit goes to github.
install GIT GUI using :
sudo apt-get install git-gui
open it using
git citool to open git gui
click help > show ssh key > copy to clipboard