ninehills / blog

https://ninehills.tech
747 stars 65 forks source link

macOS 下 ssh 推荐配置 #86

Closed ninehills closed 1 year ago

ninehills commented 2 years ago

修改 ~/.ssh/config

Host *
    # 连接重用,不需要重复登录
    ControlMaster auto
    ControlPath ~/.ssh/master-%r@%h:%p
    # Keep Alive,保持不掉线
    ServerAliveInterval 30
    ServerAliveCountMax 10000
    # SSH Key,使用系统的Keychain保存key passphase,不需要每次都输入
    # 需要将所有用到的 key 都列到此处
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa
    IdentityFile ~/.ssh/id_ed25519