Description
The ssh config files in ~/.lima/MACHINE/ssh.config include:
Host lima-MACHINE
ControlMaster auto
ControlPath "/Users/USERNAME/.lima/MACHINE/ssh.sock"
ControlPersist yes
# ...
If you want to be able to connect to the machine as more than one user, this configuration breaks it in a confusing way.
user@host$ ssh firstuser@lima-MACHINE
firstuser@lima-MACHINE$ whoami
firstuser
firstuser@lima-MACHINE$ exit
user@host$ ssh seconduser@lima-MACHINE
firstuser@lima-MACHINE$ whoami
firstuser
As a workaround you can put a line like this in ~/.ssh/config before the lima include:
Host lima-MACHINE
ControlPath ~/.lima/MACHINE/ssh.sock.%r
Include ~/.lima/*/ssh.config
But it would be nice if lima would configure this itself.
(You might prefer to use ~/.lima/MACHINE/ssh.sock.%C, which includes a hash of the username/hostname/port. The hostname doesn't help here, but the port might be useful if the user ever wanted to run a second ssh server on a different port.)
Description
The ssh config files in
~/.lima/MACHINE/ssh.configinclude:If you want to be able to connect to the machine as more than one user, this configuration breaks it in a confusing way.
As a workaround you can put a line like this in
~/.ssh/configbefore the lima include:But it would be nice if lima would configure this itself.
(You might prefer to use
~/.lima/MACHINE/ssh.sock.%C, which includes a hash of the username/hostname/port. The hostname doesn't help here, but the port might be useful if the user ever wanted to run a second ssh server on a different port.)