Skip to content

Instantly share code, notes, and snippets.

faces=12;
h1=2;
h2=2.8;
h3=1;
h4=14;
d1=18;
d2=27;
d3=30;
@yggi
yggi / apt-get ipv6.md
Created April 18, 2016 08:14
Apt-get can't connect to 'security.ubuntu.com'
@yggi
yggi / ssh_tricks.md
Last active April 18, 2016 08:08
SSH tricks

#agent-forwarding and sudo

[http://serverfault.com/questions/107187/ssh-agent-forwarding-and-sudo-to-another-user]

As you mentioned, the environment variables are removed by sudo, for security reasons.

But fortunately sudo is quite configurable: you can tell it precisely which environment variables you want to keep thanks to the env_keep configuration option in /etc/sudoers.

For agent forwarding, you need to keep the SSH_AUTH_SOCK environment variable. To do so, simply edit your /etc/sudoers configuration file (always using visudo) and set the env_keep option to the appropriate users. If you want this option to be set for all users, use the Defaults line like this: