LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 10-28-2016, 10:48 AM   #1
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 20,279

Rep: Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904Reputation: 4904
GPG Key Importing over SSH


One thing that can be irritating is having files that are PGP encrypted on one machine, and having to decrypt them on another, when you haven't moved the key over yet. A common scenario would be when you build a new machine, and want a backup of your data from a second box.

That's fine...you copy the PGP encrypted data over, then try to use it. But, the new box gives you:
Code:
gpg: decryption failed: No secret key
After copying keys on thumb drives and/or over the network, there had to be an easier way. This is one-step, and only needs SSH access between the two boxes.

First, this presumes that you've already set up PGP on both boxes, along with the necessary passphrases, etc. Once that's done, run this on the command line:
Code:
ssh user@192.193.194.195 "gpg --export-secret-key SomeKeyName" | gpg --import
A box will pop up, asking you to enter your local passphrase. Key is imported, and then all the files you encrypted on the first box can be decrypted on the second.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problems importing openvpn GPG key for lucid VListe Linux - Software 0 03-14-2012 09:17 AM
importing private gpg key into ubuntu... mia_tech Linux - Newbie 6 05-03-2008 03:07 AM
Need gpg key for skype for importing and installation O(V)eGA_l2el) Fedora 3 03-16-2008 08:33 AM
gpg encrytpion - importing public key problems aeby Linux - Security 7 05-16-2007 03:14 AM
issue importing RH GPG public key linux-singapore Linux - Software 7 12-18-2003 12:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 07:36 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