Macbook ssh免密登录

Macbook vscode 配置 ssh login

  • 生效rsa
    • rsa 报错
    • rsa-Ed25519 配置
    • ssh -config 配置

生效rsa

ssh-keygen -t rsa -C "[email protected]"
ssh-copy-id -p 22  [email protected]
ssh -vt -p 22   [email protected]

rsa 报错

no mutual signature algorithm

debug1: Next authentication method: publickey
debug1: Offering public key: /Users/.ssh/id_rsa RSA SHA256:JXYM7d2PIZ28hhg8M+EcnlepWsJMffxAg9Gu//imFm8
debug1: send_pubkey_test: no mutual signature algorithm
debug1: Trying private key: /Users/.ssh/id_ecdsa
debug1: Trying private key: /Users/.ssh/id_ecdsa_sk
debug1: Trying private key: /Users/.ssh/id_ed25519
debug1: Trying private key: /Users/.ssh/id_ed25519_sk
debug1: Trying private key: /Users/.ssh/id_xmss
debug1: Trying private key: /Users/.ssh/id_dsa
debug1: Next authentication method: password
[email protected]'s password:

解决说明
就是openssh默认不再支持ssh-rsa算法啦,说是该算法存在安全隐患

rsa-Ed25519 配置

做法是使用Ed25519, 前面的rsa 可以不必清空

# 生成 
ssh-keygen -t ed25519 -C "[email protected]"
# 复制
ssh-copy-id -p 22  [email protected]
# 检查是否能登录
ssh -vt -p 22   [email protected]


abac@QQ-MB3 .ssh % ssh -t -p 22 [email protected]
Last login: Fri Nov 25 14:24:39 2022 from 192.168.100.123

ssh -config 配置

#vi ~/.ssh/config

Host 192.168.100.123
    HostName 192.168.100.123
    User root
    Port 22
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_ed25519
    Protocol 2
    ServerAliveInterval 60

你可能感兴趣的:(go开发,linux软件,vscode,ssh,ide)