File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 162162 "type" : " string" ,
163163 "description" : " Absolute path to private key"
164164 },
165+ "useAgent" : {
166+ "type" : " boolean" ,
167+ "description" : " Auto-detect the running SSH agent (via SSH_AUTH_SOCK environment variable) and use it to perform authentication" ,
168+ "default" : false
169+ },
165170 "forwardX11" : {
166171 "type" : " boolean" ,
167172 "description" : " If true, the server will redirect x11 to the local host" ,
287292 "type" : " string" ,
288293 "description" : " Absolute path to private key"
289294 },
295+ "useAgent" : {
296+ "type" : " boolean" ,
297+ "description" : " Auto-detect the running SSH agent (via SSH_AUTH_SOCK environment variable) and use it to perform authentication" ,
298+ "default" : false
299+ },
290300 "forwardX11" : {
291301 "type" : " boolean" ,
292302 "description" : " If true, the server will redirect x11 to the local host" ,
547557 "type" : " string" ,
548558 "description" : " Absolute path to private key"
549559 },
560+ "useAgent" : {
561+ "type" : " boolean" ,
562+ "description" : " Auto-detect the running SSH agent (via SSH_AUTH_SOCK environment variable) and use it to perform authentication" ,
563+ "default" : false
564+ },
550565 "forwardX11" : {
551566 "type" : " boolean" ,
552567 "description" : " If true, the server will redirect x11 to the local host" ,
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export interface SSHArguments {
3838 host : string ;
3939 keyfile : string ;
4040 password : string ;
41+ useAgent : boolean ;
4142 cwd : string ;
4243 port : number ;
4344 user : string ;
Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ export class MI2 extends EventEmitter implements IBackend {
121121 username : args . user
122122 } ;
123123
124- if ( args . keyfile ) {
124+ if ( args . useAgent ) {
125+ connectionArgs . agent = process . env . SSH_AUTH_SOCK ;
126+ } else if ( args . keyfile ) {
125127 if ( require ( "fs" ) . existsSync ( args . keyfile ) )
126128 connectionArgs . privateKey = require ( "fs" ) . readFileSync ( args . keyfile ) ;
127129 else {
You can’t perform that action at this time.
0 commit comments