@@ -138,8 +138,10 @@ func CommonOpts(useDotSSH bool) ([]string, error) {
138
138
var opts []string
139
139
if runtime .GOOS == "windows" {
140
140
privateKeyPath = ioutilx .CanonicalWindowsPath (privateKeyPath )
141
+ opts = []string {fmt .Sprintf (`IdentityFile='%s'` , privateKeyPath )}
142
+ } else {
143
+ opts = []string {fmt .Sprintf (`IdentityFile="%s"` , privateKeyPath )}
141
144
}
142
- opts = []string {fmt .Sprintf (`IdentityFile="%s"` , privateKeyPath )}
143
145
144
146
// Append all private keys corresponding to ~/.ssh/*.pub to keep old instances working
145
147
// that had been created before lima started using an internal identity.
@@ -170,7 +172,7 @@ func CommonOpts(useDotSSH bool) ([]string, error) {
170
172
// Fail on permission-related and other path errors
171
173
return nil , err
172
174
}
173
- opts = append (opts , "IdentityFile=\" " + privateKeyPath + "\" " )
175
+ opts = append (opts , "IdentityFile='" + privateKeyPath + "' " )
174
176
}
175
177
}
176
178
@@ -229,10 +231,11 @@ func SSHOpts(instDir string, useDotSSH, forwardAgent bool, forwardX11 bool, forw
229
231
if err != nil {
230
232
return nil , err
231
233
}
234
+ controlPath := fmt .Sprintf (`ControlPath="%s"` , controlSock )
232
235
if runtime .GOOS == "windows" {
233
236
controlSock = ioutilx .CanonicalWindowsPath (controlSock )
237
+ controlPath = fmt .Sprintf (`ControlPath='%s'` , controlSock )
234
238
}
235
- controlPath := fmt .Sprintf (`ControlPath="%s"` , controlSock )
236
239
opts = append (opts ,
237
240
fmt .Sprintf ("User=%s" , u .Username ), // guest and host have the same username, but we should specify the username explicitly (#85)
238
241
"ControlMaster=auto" ,
0 commit comments