Is there a way to prevent vscode from forwarding ssh agent to remote dev container?

21 Views Asked by At

I was searching for a solution of this problem and I have encountered number of threads/topic/issues regarding ssh agent forwarding not working through vscode. My problem is quite opposite - I want to prevent vscode from forwarding agent to dev container, and I could not find solution to it neither through googling, nor through experiments.

My setup is rather simple. I am connecting to a remote server and have a container set up in there, to which I am attaching (this container is not created by vscode, it is a jupyter container spawned by a jupyterhub).

When attaching to the container, vscode code creates a socket under /tmp named vscode-ssh-auth-<id>.sock, and it is a remote endpoint to an ssh auth socket forwarded from my local machine, up to my understanding. The problem is, I want to prevent it from doing that for security reasons (I don't want to have agent sock forwarded the whole time I'm working there, as it is a shared machine), and I was not able to figure out how to do it.

I have ForwardAgent explicitly set to no for the server I'm connecting to (and I've checked that the agent is not forwarded to the server itself). I have Enable Agent Forwarding disabled in the vscode settings. I have played around with couple more settings, even checked config dirs for any clue, but found none. I have also checked whether the same happens for newly created dev container (using vscode utils), and it seems so.

I'm not sure whether I'm missing something obvious here, or it is a baked-in behaviour for some reason, but I'd appreciate any clues or clarification on this topic.

0

There are 0 best solutions below