Editing GPG Guide

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 724: Line 724:




== WSL  (Windows Subsystem for Linux) ==
* ! WIP !
Getting SSH to work in WSL.
https://github.com/drduh/YubiKey-Guide#using-multiple-keys
https://github.com/vuori/weasel-pageant
* Download and extract weasel-pagent to somewhere convenient on the windows side.
https://github.com/vuori/weasel-pageant/releases
Place this line in your .bashrc file
<syntaxhighlight lang="bash">$ nano ~./bashrc</syntaxhighlight>
<syntaxhighlight lang="bash">
# Make GNUPG / GPG work with windows smartcards weasel-pageant
eval $(<location where you unpacked the zip>/weasel-pageant -rb -a $HOME/.weasel-pageant.sock)
</syntaxhighlight>
Reload the config from the updated file:
<syntaxhighlight lang="bash">$ source ~/.bashrc</syntaxhighlight>
Add entry to the ~/.ssh/config file:
<syntaxhighlight lang="bash">nano ~/.ssh/config</syntaxhighlight>
<syntaxhighlight lang="bash">
ForwardAgent yes
RemoteForward /root/.gnupg/S.gpg-agent.ssh $HOME/.weasel-pageant.sock
</syntaxhighlight>
<syntaxhighlight lang="bash">$ chmod 600 ~/.ssh/config ; chown $USER ~/.ssh/config # Ensure you have the correct owner and permissions for the config file.</syntaxhighlight>
Test if it works:
<syntaxhighlight lang="bash">$ ssh-add -l</syntaxhighlight>
If it is working it will show your key in the list it gives.
if you get the erro :
chmod 600 ~/.ssh/config
=== Automating on Windows ===
=== Automating on Windows ===
Save the following script to a .bat file. (e.g.  `C:\scripts\gpg_refresh.bat`)
Save the following script to a .bat file. (e.g.  `C:\scripts\gpg_refresh.bat`)
Line 767: Line 739:
* Set the Name to `Check and Update GPG smartcards`
* Set the Name to `Check and Update GPG smartcards`
* Set the description to `Tell GPG to compare its keys against smartcards, and link any that match.`
* Set the description to `Tell GPG to compare its keys against smartcards, and link any that match.`
** "Name" : "1 hour"
** "Description" : "1 hour"
** "Security options" -> "Run whether user is logged on or not" : Selected. (Hides command window when task runs)
** "Security options" -> "Do not store password. The task will only have access to local computer resources." : Selected. (Prevents requiring user's password to be entered to set up task.)
* This task must be running using your user account, so that the instance of GPG associated with your account is acted on.
* This task must be running using your user account, so that the instance of GPG associated with your account is acted on.
** "Configure for:": "Windows 10"
** "Configure for:": "Windows 10"
Line 781: Line 749:
** Settings -> "Recur every" [ ] days: "1"  
** Settings -> "Recur every" [ ] days: "1"  
** "Advanced setings" -> "Repeat task every": Box checked.
** "Advanced setings" -> "Repeat task every": Box checked.
** "Advanced setings" -> "Repeat task every" : "1 hour"
** "Advanced setings" -> "Repeat task every" : `1 hour`
** "Advanced setings" -> "for a duration of" : "1 day"
** "Advanced setings" -> "for a duration of" : `1 day`
** "Advanced setings" -> "Expire": Box unchecked. (Never expire)
** "Advanced setings" -> "Expire": Box unchecked. (Never expire)
** "Advanced setings" -> "Enabled": Box checked.
** "Advanced setings" -> "Enabled": Box checked.
Line 794: Line 762:


* Click "OK" in the "Create Task" window.
* Click "OK" in the "Create Task" window.
https://stackoverflow.com/questions/4249542/run-a-task-every-x-minutes-with-windows-task-scheduler
https://stackoverflow.com/questions/4249542/run-a-task-every-x-minutes-with-windows-task-scheduler
https://www.howtogeek.com/tips/how-to-run-a-scheduled-task-without-a-command-window-appearing/
== Troubleshooting ==
To kill running background  GPG:
<syntaxhighlight lang="cmd">
gpg-connect-agent killagent /bye # Kill GPG.
</syntaxhighlight>
To start background GPG:
<syntaxhighlight lang="cmd">
gpg-connect-agent /bye # Start GPG.
</syntaxhighlight>
To inspect connected card(s?):
<syntaxhighlight lang="cmd">
gpg --card-status # Inspect smartcard.
</syntaxhighlight>


== Sources ==
== Sources ==
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)