You are not logged in.
Did a lot of Googling and searching on this forum, but I am struggling to solve this after a few hours. If I run `ssh-add -l` it says: Could not open a connection to your authentication agent.
- I copy and pasted the exact code from the wiki, so there are no spelling or formatting errors.
- Typing `systemctl --user status ssh.agent.service` shows it active and running with no errors.
- In my ~/.zprofile I have `export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"`
- I have tried reloading/restarting the service, rebooting, and sourcing my .zprofile.
- I am running i3wm, LightDM display manager, and ZSH shell.
Last edited by lv426 (2022-11-25 18:57:07)
Offline
Which code did you copy-paste from the wiki and where did you paste it exactly?
What is the actual output of systemctl --user status ssh-agent.service? (Note the hyphen rather than the dot - according to the wiki.)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
In my ~/.zprofile
I am running … LightDM display manager, …
https://man.archlinux.org/man/extra/zsh … DOWN_FILES
Your zprofile is irrelevant in this context, zsh isn't your login shell, https://wiki.archlinux.org/title/Enviro … nvironment
Try ~/.xprofile (but idk. whether lightdm executes that)
Other than that, please of course also answer cfr's questions
Offline
Which code did you copy-paste from the wiki and where did you paste it exactly?
What is the actual output of systemctl --user status ssh-agent.service? (Note the hyphen rather than the dot - according to the wiki.)
Sorry about that. Section 4.1.1: Start ssh-agent with systemd user
It is possible to use the systemd/User facilities to start the agent. Use this if you would like your ssh agent to run when you are logged in, regardless of whether x is running.
~/.config/systemd/user/ssh-agent.service
[Unit]
Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
# DISPLAY required for ssh-askpass to work
Environment=DISPLAY=:0
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.targetThen export the environment variable SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" in your login shell initialization file, such as ~/.bash_profile or ~/.zprofile.
Finally, enable or start the service with the --user flag.Here is the code you asked for. I didn't mean to put a period in my original post.
● ssh-agent.service - SSH key agent
Loaded: loaded (/home/lv426/.config/systemd/user/ssh-agent.service; enabled; preset: enabled)
Active: active (running) since Wed 2022-11-16 13:04:36 PST; 12min ago
Main PID: 416 (ssh-agent)
Tasks: 1 (limit: 4659)
Memory: 1.4M
CPU: 6ms
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/ssh-agent.service
└─416 /usr/bin/ssh-agent -D -a /run/user/1000/ssh-agent.socket
Nov 16 13:04:36 arch ssh-agent[416]: SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket; export SSH_AUTH_SOCK;
Nov 16 13:04:36 arch ssh-agent[416]: echo Agent pid 416;
Nov 16 13:04:36 arch systemd[407]: Started SSH key agent.Offline
printenv | grep SSH_AUTH_SOCKCLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
printenv | grep SSH_AUTH_SOCK
No results are returned.
Offline
Quelle surprise.
Your zprofile is irrelevant … Try ~/.xprofile
Offline
Quelle surprise.
seth wrote:Your zprofile is irrelevant … Try ~/.xprofile
You say it's irrelevant but why is it listed on the wiki? Is the article out of date?
I don't have an ~/.xprofile, just ~/xinitrc, though of course I could make it.
Offline
It's in the wiki because it would work if you used zsh as your login shell, but you don't you start a DM which doesn't use a login shell for login you in. .xprofile is what should/will be parsed by most display managers, assuming it exists, so yes, create that.
Offline
Is the article out of date?
No.
zsh isn't your login shell
I don't have an ~/.xprofile, … though of course I could make it.
Yes. Of course.
just ~/xinitrc,
If you're using lightdm, that's likewise irrelevant.
Offline
I created .xprofile and added the necessary line, but it still cannot open a connection to the authentication agent.
I reloaded the service, as well as rebooted.
printenv | grep SSH_AUTH_SOCK still shows nothing
Offline
You added what line? Post it. It should be
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"and yo
Offline