在 mac 上生成了与 git 一起使用的公共 rsa 密钥,但找不到它?

发布于 2024-08-23 11:48:42 字数 399 浏览 8 评论 0原文

我使用的是 mac os X(刚接触它),需要生成一个公共 rsa 密钥以与 git 一起使用(我想我是对的)。我按照此处的说明进行操作:

http://help.beanstalkapp.com/faqs/git/generate-and-adding-ssh-keys-on-mac-os-x

并在我家里生成了名为 (id_rsa.pub) 的密钥目录,但当我执行 ls 或通过文件资源管理器 gui 查看时,我看不到它。是不是像隐藏文件之类的?我怎样才能看到它?我需要将公钥通过电子邮件发送给某人,

谢谢

I'm on mac os X (new to it) and need to generate a public rsa key for use with git (think I got that right). I'm following the directions here:

http://help.beanstalkapp.com/faqs/git/generating-and-adding-ssh-keys-on-mac-os-x

and have generated the key named (id_rsa.pub) in my home directory, but I don't see it there when I do ls, or when I view through the file explorer gui. Is it like a hidden file or something? How can I see it? I need to email the public key to someone,

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

清秋悲枫 2024-08-30 11:48:49

您可以通过在终端中执行此命令来直接将密钥复制到剪贴板

cat ~/.ssh/id_rsa.pub | pbcopy

you can directly copy the key to the clipboard by executing this command in your terminal

cat ~/.ssh/id_rsa.pub | pbcopy
无敌元气妹 2024-08-30 11:48:49

以下命令可用于将公钥复制到剪贴板中。

pbcopy < ~/.ssh/id_rsa.pub

The following command can be used to copy the public key in your clipboard.

pbcopy < ~/.ssh/id_rsa.pub
北笙凉宸 2024-08-30 11:48:49

在 Mac book 中

列出生成的 ssh 密钥

ls ~/.ssh

获取公钥:

cat ~/.ssh/id_edxxxx.pub

复制公钥并将其粘贴到您的 GitHub 或 Gitlab 帐户中

验证真实性
对于 GitHub:

ssh -T [email protected]

对于 Gitlab:

ssh -T [email protected]

对于自定义 gitlab 帐户:

ssh -T [email protected]

要将它们添加到已知主机列表中,请输入:yes

In Mac book

To list generated ssh key

ls ~/.ssh

To get public key:

cat ~/.ssh/id_edxxxx.pub

Copy the public key and paste them into your GitHub or Gitlab account

To verify authenticity
For GitHub :

ssh -T [email protected]

For Gitlab :

ssh -T [email protected]

For custom gitlab account:

ssh -T [email protected]

To add them in known host list type: yes

烟若柳尘 2024-08-30 11:48:48

默认情况下,它将密钥存储在隐藏的 ~/.ssh 目录中。
所有以句点开头的目录都是隐藏的,但可以通过直接命名它们或指定 . 来查看,如下所示:

ls .*

因此,要获取副本,您可以输入 cp ~/ .ssh/id_rsa.pub ~/ 它将出现在您的主目录中。

By default it stores the key in the ~/.ssh directory, which is hidden.
All directories that start with a period are hidden, but can be seen either by directly naming them or by specifying the ., as in:

ls .*

So to get a copy, you can type cp ~/.ssh/id_rsa.pub ~/ and it'll appear in your home directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文