Skip to content

Commit 956b048

Browse files
committed
Don't useDotSSHPubKeys for limactl copy command
It fails if there is a public key without a corresponding private key in ~/.ssh. useDotSSHPubKeys should not be needed for the copy command except when using it on legacy instances. Document how to make those instances compatible. Signed-off-by: Jan Dubois <[email protected]>
1 parent 86d6a93 commit 956b048

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ The current default spec:
201201
- [SSH](#ssh)
202202
- ["Port forwarding does not work"](#port-forwarding-does-not-work)
203203
- [stuck on "Waiting for the essential requirement 1 of X: "ssh"](#stuck-on-waiting-for-the-essential-requirement-1-of-x-ssh)
204+
- ["permission denied" for `limactl cp` command](#permission-denied-for-limactl-cp-command)
204205
- ["Hints for debugging other problems?"](#hints-for-debugging-other-problems)
205206

206207
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -295,6 +296,14 @@ Privileged ports (1-1023) cannot be forwarded. e.g., you have to use 8080, not 8
295296
libslirp v4.6.0 used by QEMU is known to be [broken](https://gitlab.freedesktop.org/slirp/libslirp/-/issues/48).
296297
If you have libslirp v4.6.0 in `/usr/local/Cellar/libslirp`, you have to upgrade it to v4.6.1 or later (`brew upgrade`).
297298

299+
#### "permission denied" for `limactl cp` command
300+
301+
The `copy` command only works for instances that have been created by lima 0.5.0 or later. You can manually install the required identity on older instances with (replace `INSTANCE` with actual instance name):
302+
303+
```console
304+
< ~/.lima/_config/user.pub limactl shell INSTANCE sh -c 'tee -a ~/.ssh/authorized_keys'
305+
```
306+
298307
### "Hints for debugging other problems?"
299308
- Inspect logs:
300309
- `limactl --debug start`

cmd/limactl/copy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func copyAction(clicontext *cli.Context) error {
3636
return err
3737
}
3838

39-
const useDotSSH = true
39+
const useDotSSH = false
4040
args, err := sshutil.CommonArgs(useDotSSH)
4141
if err != nil {
4242
return err

0 commit comments

Comments
 (0)