Skip to content

SSH: enable ssh agent #118

@petRUShka

Description

@petRUShka

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 }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions