Recently, ssh-agent stopped working. - I boot like this: systemd-242 (+pam) / lightdm / openbox. - ssh-agent does not appear automatically anymore. - When run manually, ssh-add cannot find a socket. - I cannot find a proper Gentoo way/doc on a proper setup. - I tried all openssh versions in portage up to 8.x. What I've tried so far: - I followed [1] to configure a systemd user process for ssh-agent; this brought back the ssh-agent on next reboot. - ~/.ssh/config has: AddKeysToAgent yes. - Setting ~/.pam_environment to > > SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh-agent.socket" > does not seem to be correct for Gentoo as env will then show SSH_AUTH_SOCK=/ssh-agent.socket (as if XDG_RUNTIME_DIR was empty). In turn, calling ssh-add still can't find the socket. - When instead, after boot, doing manually > > export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket > then ssh-add seems to find the socket, asks for a password but then hangs forever with one CPU at 100%. Hm... [1] https://unix.stackexchange.com/questions/339840/how-to-start-and-use-ssh-agent-as-systemd-service
It is sad to read that you have problems with the software. The situation seems to be a bit more complicate and requires some analysis. We can not help you efficiently via bug tracker. The bug tracker aims rather on specific problems in .ebuilds and less on individual systems. I have had very good experience on the gentoo IRC [1] with questions like this. Of course there are also forums and mailing lists [2,3]. I hope you understand, that I will close the bug here therefore and wish you good luck on one of the mentioned channels [4]. Please reopen the ticket in order to provide an indication for an specific error in an ebuild or any gentoo related product. [1] https://www.gentoo.org/get-involved/irc-channels/ [2] https://forums.gentoo.org/ [3] https://www.gentoo.org/get-involved/mailing-lists/all-lists.html [4] https://www.gentoo.org/support/
I've edited this issue since it became clearer now. openssh compiled with lto makes ssh-add to hang at 100% CPU. I've tried up to openssh-7.7.x, 7.9.x, 8.0.x. A simple test case: - run ssh-agent manually, into new shell: ssh-agent /bin/bash - ssh-add (brings PW entry) - type PW + enter Hangs, CPU at 100%.
I am unable to reproduce this problem with the following config: CFLAGS="-O2 -pipe -march=amdfam10 -flto" LDFLAGS="-flto" net-misc/openssh-8.0_p1-r1 sys-apps/systemd-242-r1
Ok, so a bit more info from my test case: gcc-8.3.0-r1 net-misc/openssh-8.0_p1-r1 /proc/cpuinfo: model name: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (1) This makes ssh-add hang: CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=native -g0 -O3 -pipe -fomit-frame-pointer -mindirect-branch=thunk -mfunction-return=thunk -mindirect-branch-register" CFLAGS="${CFLAGS} -flto=5 -fuse-linker-plugin" LDFLAGS="${LDFLAGS} -Wl,--as-needed -Wl,-O2 ${CFLAGS}" AR=gcc-ar RANLIB=gcc-ranlib NM=gcc-nm (2) This is my no-lto.conf what makes it work when applied: CFLAGS="${CFLAGS} -fno-lto -fno-use-linker-plugin" CXXFLAGS="${CXXFLAGS} -fno-lto -fno-use-linker-plugin" LDFLAGS="${LDFLAGS} -fno-lto -fno-use-linker-plugin"
Can you still hit this?
No. Thanks for asking.