在 mac 上生成了与 git 一起使用的公共 rsa 密钥,但找不到它?
我使用的是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以通过在终端中执行此命令来直接将密钥复制到剪贴板
you can directly copy the key to the clipboard by executing this command in your terminal
以下命令可用于将公钥复制到剪贴板中。
The following command can be used to copy the public key in your clipboard.
在 Mac book 中
列出生成的 ssh 密钥
获取公钥:
复制公钥并将其粘贴到您的 GitHub 或 Gitlab 帐户中
验证真实性
对于 GitHub:
对于 Gitlab:
对于自定义 gitlab 帐户:
要将它们添加到已知主机列表中,请输入:yes
In Mac book
To list generated ssh key
To get public key:
Copy the public key and paste them into your GitHub or Gitlab account
To verify authenticity
For GitHub :
For Gitlab :
For custom gitlab account:
To add them in known host list type: yes
默认情况下,它将密钥存储在隐藏的
~/.ssh
目录中。所有以句点开头的目录都是隐藏的,但可以通过直接命名它们或指定
.
来查看,如下所示:因此,要获取副本,您可以输入
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:So to get a copy, you can type
cp ~/.ssh/id_rsa.pub ~/
and it'll appear in your home directory.