Mac生成ssh和查看ssh key

mac 系统开始就已经为我们安装了ssh 如果没有安装,

首先安装打开终端:$ ssh -v

查看ssh版本

usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]

           [-D [bind_address:]port] [-e escape_char] [-F configfile]

           [-I pkcs11] [-i identity_file]

           [-L [bind_address:]port:host:hostport]

           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]

           [-R [bind_address:]port:host:hostport] [-S ctl_path]

           [-W host:port] [-w local_tun[:remote_tun]]

           [user@]hostname [command]

这个表明ssh已经安装.

如果没有安装,在终端输入以下命令

$ ssh-keygen -t rsa -C "youremail@example.com"

一路回车确定下就安装好了。

生成在当前用户名下会有一个.sh文件。

查看 .ssh

$ ls -a ~/.ssh  通过搜索目录

id_rsa

id_rsa.pub

打开 id_rsa.pub文件 里面就有需要的ssh key。

在终端输入命令打开id_rsa.pub

vim ~/.ssh/id_rsa.pub

将.pub中的多有内容拷贝出来填到git账户里面就ok了

 

Back in your terminal window, copy the contents of your public key file.

For example, in Linux you can cat the contents.

$ cat ~/.ssh/id_rsa.pub

In Mac OSX, the following command copies the output to the clipboard:

$ pbcopy < ~/.ssh/id_rsa.pub
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值