8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sudo後もSSH Agent Forwardingしたい

Last updated at Posted at 2014-10-22

そんな場合は、/etc/sudoers に以下を追記しておけば良い。

/etc/sudoers
Defaults env_keep += "SSH_AUTH_SOCK"

最近知って便利だったのでメモ。

即座にAnsible Role化

最近、設定系のTipsはとりあえずAnsibleのロール化した形でメモるようにしてる。

sudoers/tasks/main.yml
- name: allow agentforward sudo
  lineinfile: >
    dest=/etc/sudoers
    line="Defaults env_keep += \"SSH_AUTH_SOCK\""
    regexp="^Defaults +env_keep *\+= *\"SSH_AUTH_SOCK\""
    state=present
8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?