Skip to content

Instantly share code, notes, and snippets.

@nukhes
Created November 26, 2025 09:47
Show Gist options
  • Select an option

  • Save nukhes/7938f46570f4c5be409bf415713ff1f8 to your computer and use it in GitHub Desktop.

Select an option

Save nukhes/7938f46570f4c5be409bf415713ff1f8 to your computer and use it in GitHub Desktop.
Enviar copia de sua chave SSH automáticamente pra um server ou VM
```
ssh-keygen -t rsa
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh usuario@IPADDRESS "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
```
Permissões dentro da VM
```bash
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
```
```
ssh usuario@IPADDRESS
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment