LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I copy my public key into a .txt file? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-copy-my-public-key-into-a-txt-file-940142/)

abst2act 04-16-2012 09:50 PM

How do I copy my public key into a .txt file?
 
Trying to figure out how to copy or even view my public rsa key from terminal. I know how to do it on a Mac
Code:

$ pbcopy < ~/.ssh/id_rsa.pub
$ pbpaste > ~/clipboard.text

but am having trouble figuring it out on Ubuntu. Any help would be greatly appreciated.

Tinkster 04-16-2012 10:15 PM

Hi, welcome to LQ!

And I'm somewhat confused by your question ... ~/.ssh/id_rsa.pub *IS* a text file.
You can copy the file.

cp ~/.ssh/id_rsa.pub new.txt


Cheers,
Tink

suicidaleggroll 04-16-2012 10:15 PM

Code:

cp ~/.ssh/id_rsa.pub ~/file.txt
To view it, just open ~/.ssh/id_rsa.pub in a text editor like vi, nano, emacs, etc., or use cat to dump the contents to the terminal:

Code:

cat ~/.ssh/id_rsa.pub

Edit: beat to the punch

abst2act 04-18-2012 03:32 PM

You guys are awesome thanks fellas!


All times are GMT -5. The time now is 01:03 PM.