Env variable of user unit of ssh-agent not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi,

I followed

https://wiki.archlinux.org/title/SSH_keys#Start_ssh-agent_with_systemd_user

It seems that SSH_AUTH_SOCK does not get set although it is in the user unit 
file.

$ systemctl --user status ssh-agent.service                                                                                                                                                                            
● ssh-agent.service - SSH key agent
     Loaded: loaded (/home/rd/.config/systemd/user/ssh-agent.service; enabled; 
vendor preset: enabled)
     Active: active (running) since Fri 2022-01-21 21:14:16 CET; 7min ago
   Main PID: 574 (ssh-agent)
      Tasks: 1 (limit: 9331)
     Memory: 920.0K
        CPU: 9ms
     CGroup: /user.slice/user-2809.slice/user@2809.service/app.slice/ssh-
agent.service
             └─574 /usr/bin/ssh-agent -D -a /run/user/2809/ssh-agent.socket

Jan 21 21:14:16 n3150 ssh-agent[574]: SSH_AUTH_SOCK=/run/user/2809/ssh-
agent.socket; export SSH_AUTH_SOCK;
Jan 21 21:14:16 n3150 ssh-agent[574]: echo Agent pid 574;
Jan 21 21:14:16 n3150 systemd[564]: Started SSH key agent.
 $ cat .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.target
 $ ssh-add                                                                                                                                                                                                                     
Could not open a connection to your authentication agent.
 $ echo $SSH_AUTH_SOCK                                                                                                                                                                                                       

 $ 

Can anybody tell what I am missing?

Any hint or advice is welcome.

Thanks
Rainer

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux