# .ssh/config dosyası ne işe yarar

![](https://i.imgur.com/iFNsZC8.png)

```python
Host my.host
    HostName 123.123.32.231
    User username
		IdentityFile ".ssh/rsa.pem"
		ForwardAgent yes

# Tüm sunucular için ortak ayarlar
Host *
  ForwardAgent yes
  AddKeysToAgent yes
```

* `.ssh/config` dosyasına sunuculara bağlanmak için gerekli bilgileri kaydederiz
* `HostName` sunucunun IP adresi
* `User` sunucudaki kullanıcı adı
* `IdentityFile` sunucuya bağlanmak için kullanılacak anahtar dosya
* `AddKeysToAgent` tekrardan bağlantılar için anahtarı saklar

<details>

<summary>`ForwardAgent` lokal **agent** bilgilerini uzan sunucuya aktarır</summary>

\- \*\*Git SSH auth\*\* varsa eğer lokalde, karşı sunucuya da bu aktarılır

</details>

> `ssh my.host` komutu ile aslında `ssh -A username@123.123.32.231 -i .ssh/rsa.pem` kodunu yazmış oluruz


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yemreak.com/arsiv/programming/sshconfig-dosyasi-ne-ise-yarar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
