2

I have followed the instructions here https://www.funtoo.org/Keychain and added

eval `keychain --eval --agents ssh --inherit any id_rsa`

to - I have tried both but the result was the same - .zshrc and .zprofile. Now the first terminal that I open requires me to enter the password for the SSH key (as expected) but after that, I never need to enter the password, independently of how many terminals I open.

However, if I log in to this machine using SSH I need to enter the SSH key password every time I connect. Obviously there is some difference how the shell is setup if I open a new terminal session sitting in front of the machine or open an SSH session.

How do I make SSH logins "inherit" the Funtoo Keychain setup/environment so I don't need to enter the password for the SSH key every time I log in to this machine using SSH?

7
  • unix.stackexchange.com/questions/537637/… have you checked if it runs as a login shell? if [[ -o login ]]; then; print yes; else; print no; fi it should
    – dza
    Commented Aug 22, 2020 at 13:40
  • @dza I am not sure I understand how to use the linked Q&A in my situation. Do you think you could elaborate? Thank you.
    – d-b
    Commented Aug 20, 2023 at 9:46
  • use snippet I posted in prev comment and report back if it says yes or no in the term you tried.
    – dza
    Commented Aug 20, 2023 at 11:00
  • @dza I SSH from A to B. Your snippet returns "yes" on both A and B.
    – d-b
    Commented Aug 20, 2023 at 13:31
  • I just reread question, its been 3 years and now I think I can answer your question.. Look for ${HOME}/.keychain/${HOST}-sh directory in home.. this is where you can source source ~/.keychain/hostname-sh that file and your keychain should be initiated with the ssh-agent PID I think, try to read the file.. it sets environment variable..
    – dza
    Commented Aug 20, 2023 at 17:37

0

You must log in to answer this question.

Browse other questions tagged .