pigmonkey / spark

Arch Linux Provisioning with Ansible
The Unlicense
387 stars 114 forks source link

SSH: enable ssh agent #118

Open petRUShka opened 5 days ago

petRUShka commented 5 days ago

Arch wiki in section Start ssh-agent with systemd user proposes:

If you would like your ssh agent to run when you are logged in, regardless of whether X is running, a handy ssh-agent.service is included in openssh since the version 9.4p1-3, which can be enabled as a user unit.

So maybe it is useful to add something like this in ssh role:

- name: Enable ssh-agent service
  service:
    name: ssh-agent.service
    enabled: yes
    state: started
    scope: user
  become: yes
  become_user: "{{ user.name }}"
  environment:
    XDG_RUNTIME_DIR: "/run/user/{{ user.uid }}"
pigmonkey commented 4 days ago

I use GPG agent for my SSH, so I'm not interested in this. For people who do use SSH agent, I think launching it from one's shell config is still common. I'm not sure that there is an appeal to outsourcing that to systemd. But I'd accept a pull request for this as long as it depended on a variable that was disabled by default.