Eagle233-Blog

[Server] 密钥登录服务器


Categories Server
Tags

118 Words   |   1 Minutes

在 Mac 执行:

chmod 600 ~/.ssh/id_rsa.pem
ssh-keygen -p -f ~/.ssh/id_rsa.pem

然后设置一个新的、较长的 passphrase。这个操作只加密本地私钥,不会改变公钥,也不需要修改京东云服务器。
再收紧权限

chmod 400 ~/.ssh/id_rsa.pem

将它保存到 macOS 钥匙串:

/usr/bin/ssh-add --apple-use-keychain ~/.ssh/id_rsa.pem

然后把京东云配置改为:

Host Eagle233-JDCloud
    HostName 127.0.0.1
    User eagle233
    IdentityFile ~/.ssh/id_rsa.pem
    IdentitiesOnly yes
    AddKeysToAgent yes
    UseKeychain yes

Page views: Loading...  ·  Visitors: Loading...
Except where otherwise noted, original content on this site is dedicated to the public domain under CC0 1.0.
Powered by Hexo & Theme mdsuper
沪ICP备2026040813号
Search