Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-16-2012, 09:50 PM   #1
LQ Newbie
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
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
$ pbcopy < ~/.ssh/
$ pbpaste > ~/clipboard.text
but am having trouble figuring it out on Ubuntu. Any help would be greatly appreciated.
Old 04-16-2012, 10:15 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Hi, welcome to LQ!

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

cp ~/.ssh/ new.txt

Old 04-16-2012, 10:15 PM   #3
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,569

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

cat ~/.ssh/

Edit: beat to the punch

Last edited by suicidaleggroll; 04-16-2012 at 10:17 PM.
Old 04-18-2012, 03:32 PM   #4
LQ Newbie
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
You guys are awesome thanks fellas!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Parallelizing Copying public key to authorized_keys file the_gripmaster Linux - Networking 4 01-25-2012 01:23 PM
SSH skips public key authentication for a key, but works with another key simopal6 Linux - General 1 07-06-2011 08:33 AM
Copy the contents of a txt file to other txt files (with similar names) by cp command TheIndependentAquarius Linux - Newbie 7 07-03-2010 12:54 AM
Using key to match against source.txt file to add xml tags to names in Perl ginny2010 Programming 3 06-22-2010 01:16 PM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration