Skip to content

Commit d4a5454

Browse files
CopilotAkihiroSuda
andcommitted
Document SSH config Include usage for easier Lima instance access
- Add section explaining how to configure ~/.ssh/config with Include directive - Show examples of direct SSH access (ssh lima-{NAME}) - Include practical usage examples (rsync) - Document alternative Match all syntax for existing configs - Add use cases for VSCode, Ansible, SFTP, and SSHFS - Add note about SSHFS limitations on non-Linux platforms Co-authored-by: AkihiroSuda <[email protected]>
1 parent b69963d commit d4a5454

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

website/content/en/docs/usage/_index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,43 @@ $ limactl ls --format='{{.SSHConfigFile}}' default
5959
$ ssh -F /Users/example/.lima/default/ssh.config lima-default
6060
```
6161

62+
#### Using SSH without the `-F` flag
63+
64+
For easier SSH access, you can configure your `~/.ssh/config` to automatically include Lima's SSH configurations:
65+
66+
```
67+
Include ~/.lima/*/ssh.config
68+
```
69+
70+
Add this line to the beginning of your `~/.ssh/config` file. If you have existing `Host` entries in your SSH config, you may need to use the following format instead:
71+
72+
```
73+
Match all
74+
Include ~/.lima/*/ssh.config
75+
```
76+
77+
After adding this configuration, you can connect to Lima instances directly:
78+
79+
```bash
80+
# Connect to the default instance
81+
ssh lima-default
82+
83+
# Connect to a named instance
84+
ssh lima-ubuntu
85+
86+
# Use SSH with other tools
87+
rsync -a -e ssh . lima-default:/tmp/repo
88+
```
89+
90+
This SSH integration also enables Lima instances to work seamlessly with various tools:
91+
92+
- **VSCode**: Use the Remote-SSH extension to connect to `lima-{NAME}`
93+
- **Ansible**: Target Lima instances using their SSH hostnames in inventory files
94+
- **SFTP**: Transfer files using `sftp lima-{NAME}`
95+
- **SSHFS**: Mount remote filesystems with `sshfs lima-{NAME}: /local/mountpoint`
96+
97+
> **Note**: SSHFS may have limitations on non-Linux platforms like macOS and Windows.
98+
6299
### Shell completion
63100
- To enable bash completion, add `source <(limactl completion bash)` to `~/.bash_profile`.
64101
- To enable zsh completion, see `limactl completion zsh --help`

0 commit comments

Comments
 (0)