diff --git a/website/content/en/docs/faq/_index.md b/website/content/en/docs/faq/_index.md index 275cdefb0e4..de526b310c1 100644 --- a/website/content/en/docs/faq/_index.md +++ b/website/content/en/docs/faq/_index.md @@ -50,12 +50,9 @@ weight: 6 Password is disabled and locked by default. You have to use `limactl shell bash` (or `lima bash`) to open a shell. -Alternatively, you may also directly ssh into the guest: `ssh -p -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1`. -The port number can be inspected by running `limactl list`. -e.g., -```bash -limactl list --format '{{ .SSHLocalPort }}' default -``` +{{% fixlinks %}} +Try virtiofs. See [`Usage ยป SSH`]({{< ref "/docs/usage/ssh" >}}) +{{% /fixlinks %}} #### "Does Lima work on ARM Mac?" Yes diff --git a/website/content/en/docs/usage/_index.md b/website/content/en/docs/usage/_index.md index 7a77bb564c4..d6ec151112a 100644 --- a/website/content/en/docs/usage/_index.md +++ b/website/content/en/docs/usage/_index.md @@ -50,28 +50,6 @@ lima uname -a ``` The `lima` command also accepts the instance name as the environment variable `$LIMA_INSTANCE`. - -SSH can be used too: -```console -$ limactl ls --format='{{.SSHConfigFile}}' default -/Users/example/.lima/default/ssh.config - -$ ssh -F /Users/example/.lima/default/ssh.config lima-default -``` - -#### Using SSH without the `-F` flag - -To connect directly without specifying the config file, add this to your `~/.ssh/config`: - -``` -Include ~/.lima/*/ssh.config -``` - -Then you can connect directly: -```bash -ssh lima-default -``` - ### Shell completion - To enable bash completion, add `source <(limactl completion bash)` to `~/.bash_profile`. - To enable zsh completion, see `limactl completion zsh --help` diff --git a/website/content/en/docs/usage/ssh.md b/website/content/en/docs/usage/ssh.md new file mode 100644 index 00000000000..6903fafc701 --- /dev/null +++ b/website/content/en/docs/usage/ssh.md @@ -0,0 +1,45 @@ +--- +title: SSH +weight: 3 +--- + +Instead of the `limactl shell` command, SSH can be used too: + +```console +$ limactl ls --format='{{.SSHConfigFile}}' default +/Users/example/.lima/default/ssh.config + +$ ssh -F /Users/example/.lima/default/ssh.config lima-default +``` + +This is useful for interoperability with other software that expects the SSH connectivity. + +## Using SSH without additional options + +Add the following line to your `~/.ssh/config`: + +``` +Include ~/.lima/*/ssh.config +``` + +Then you can connect directly without specifying `-F`: +```bash +ssh lima-default +``` + +This configuration is notably useful for the Remote Development mode of [Visual Studio Code](../examples/vscode.md). + +## Using SSH without a config file + +If your SSH client does not support a config file, try specifying an equivalent of the following command: + +```bash +ssh -p -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1 +``` + +The port number can be inspected as follows: +```bash +limactl list --format '{{ .SSHLocalPort }}' default +``` + +See also `.lima/default/ssh.config`. \ No newline at end of file