You are not logged in.
In the past I used keychain to manage my ssh key within one boot period across terminal sessions as described in the Wiki:
eval $(keychain --eval --agents ssh -Q --quiet /home/cutuchiqueno/.ssh/id_rsa)Lately, I created more ssh keys for different services and also started to let keychain manage gpg-agent:
eval $(keychain --eval --agents ssh,gpg -Q --quiet /home/cutuchiqueno/.ssh/id_rsa /home/cutuchiqueno/.ssh/id_rsa_pi B41F933C)However, after changing the config this way I get the following error when I open a second terminal and after I already provided passwords in the first terminal
* Warning: can't find /home/cutuchiqueno/.ssh/id_rsa; skipping
* Warning: can't find /home/cutuchiqueno/.ssh/id_rsa_pi; skippingNevertheless, authentication to the associated remotes and services works perfectly.
I am using zsh within termite
Thx.
Last edited by cutuchiqueno (2017-01-03 11:42:31)
Offline
Where are you invoking keychain: in .zshrc?
Offline
"PATH_TO_SSHKEY1" is redacted? Don't do that - the filename is no secret and you should check whether it (or whatever you enter there, eg. a variable or a command) is there.
@jasonwryan: because it's suggested in the wiki ;-P
https://wiki.archlinux.org/index.php/SSH_keys#Keychain
@cutuchiqueno
the idea is to run that *once* per session, eg. with some desktop init script or, in your case, rather a systemd user service - not in every shell instance.
Offline
@jasonwryan yes, in .zshrc following the page mentioned by @seth
@seth ok, I understand the argument why it is better to use with systemd. However, I still do not understand why it worked before but not anymore when I add a second ssh key and a gpg key.
Two additional personal problems for me are that systemd service files are still a mysterious world to me and after reading your response I haven't found any example service file doing that job. Or can I just do the same example with gpg-agent, given at https://wiki.archlinux.org/index.php/Gn … stemd_user to ssh-agent?
Second question is one of understanding: Is the reason to invoke keychain in .zshrc not the possibility to directly enter the passhrases in the open terminal. Ok, gpg has pinentry to popup but ssh does not have a similar component, does it? So I need the open terminal to enter the passphrase, don't I?
Last edited by cutuchiqueno (2017-01-03 10:49:21)
Offline
I decided to let gpg-agent handle ssh keys as it is described in the wiki article on GnuPG and dropped keychain. It works well. The decision was provoked by @seth's recommendation to use systemd. So, thank you!
Offline
Well about why it work and doesn't - the error is that the passed files do not (no longer?) exist, so the answer will be in
- what are those files exactly
- are they really gone after the first shell invocation?
You could test for their existance to branch the keychain invocation (if you ever return)
Systemd user services are explained here: https://wiki.archlinux.org/index.php/Systemd/User
Look at the example to autostart X11 (and translate it to autorun keychain)
Offline
.zshrc is the wrong file; call it from .zprofile
Offline