```bash
/home/<USER>/.ssh/id_rsa
C:\User\<user>\.ssh\id_rsa
# login with private key
ssh -i key user@$IP
sudo chown kali:kali key
sudo chmod 600 key
# Windows
ssh -i key user@$IP "cmd.exe"
ssh -i key -t user@$IP "cmd.exe"
ssh -i key -t user@$IP "powershell.exe -NoLogo -NoProfile"
ssh -i key -T user@$IP "cmd.exe"
ssh -i key -T user@$IP "powershell.exe -NoLogo -NoProfile"
ssh -i key user@$IP -vvv
# ssh 단순화
ssh -i key user@$IP -o SetEnv=TERM=vt100
TERM=vt100 ssh -i key user@$IP
```
# Keys
```bash
/home/<user>/.ssh/authorized_keys
/home/<user>/.ssh/id_rsa
/home/<user>/.ssh/id_rsa.pub
```
| 파일명 | 설명 | 관련 공개키 파일 |
| ------------ | ------------------------------------------------- | ---------------- |
| `id_rsa` | **RSA 알고리즘 기반 개인키** (가장 전통적) | `id_rsa.pub` |
| `id_ecdsa` | **ECDSA(Elliptic Curve)** 기반 개인키 | `id_ecdsa.pub` |
| `id_ed25519` | **ED25519(고속·보안성 높음)** 기반 개인키 — **현재 가장 권장되는 형식** | `id_ed25519.pub` |
| `id_dsa` | **DSA** 기반 개인키 (오래된 방식, 현재는 비권장) | `id_dsa.pub` |
|파일명|설명|
|---|---|
|`authorized_keys`|서버 측에 저장되는 **허용된 공개키 목록** (접속 허용용)|
|`known_hosts`|클라이언트 측에서 접속했던 **서버들의 공개키 정보 저장 파일**|
|`id_github`, `id_gitlab`, `id_work`, `id_personal`|여러 계정을 관리할 때 **사용자가 구분해서 이름을 붙이는 경우**|
|`id_rsa-cert.pub`|**서명된 공개키 (certificate)**, SSH 인증서 기반 로그인 시 사용|
|`ssh_host_rsa_key`, `ssh_host_ed25519_key`|**서버(host key)** — SSH 서버 자체의 신원 식별용 키|