LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
Old 04-16-2012, 11:15 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,561

Rep: Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127Reputation: 2127
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

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

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


Reply


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 02:23 PM
SSH skips public key authentication for a key, but works with another key simopal6 Linux - General 1 07-06-2011 09: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 01:54 AM
Using key to match against source.txt file to add xml tags to names in Perl ginny2010 Programming 3 06-22-2010 02: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 06:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 PM.

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