Mac系统生成publicKey(ssh .pub key)
2016-11-05 09:26
253 查看
iOS开发中不免要上传gitHub上或者公司要求git管理代码,就会需要你本机生成的ssh publickey。
下面把生成的.pub文件传给后台或服务器就好了:
1、打开终端:$ ssh -v
会出现:
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] [user@]hostname [command]
说明你的电脑有ssh文件;
2、然后就要去生成了:
$ ssh-keygen
就会出现以下代码:然后一路 :Enter
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/yinqiangqiang/.ssh/id_rsa):
/Users/yinqiangqiang/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/yinqiangqiang/.ssh/id_rsa.
Your public key has been saved in /Users/yinqiangqiang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:8QPUtJr5g4NCKiwJXHkYQ7V27NjZmMQF9Md0N/2edKs yinqiangqiang@yinqianangdeMBP
The key's randomart image is:
+---[RSA 2048]----+
| .+...oo+.. . o.|
| = +.o +.. . o|
| + + =o..o .|
|. . o * =B. .o|
|.. .. *S.o ..+|
|o. o . o . o.|
|+.. . . o o . |
|.. . . . E |
| |
+----[SHA256]-----+
生成成功,然后 打开,由于这是一个隐藏文件。所以用终端打开比较方便
3、打开:
$ ls -a ~/.ssh
显示:
. ..
id_rsa id_rsa.pub
known_hosts
生成成功。
这个id_rsa.pub 就是我们要得到的公钥。
下面把生成的.pub文件传给后台或服务器就好了:
1、打开终端:$ ssh -v
会出现:
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
[-D [bind_address:]port] [-E log_file] [-e escape_char]
[-F configfile] [-I pkcs11] [-i identity_file] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] [user@]hostname [command]
说明你的电脑有ssh文件;
2、然后就要去生成了:
$ ssh-keygen
就会出现以下代码:然后一路 :Enter
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/yinqiangqiang/.ssh/id_rsa):
/Users/yinqiangqiang/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/yinqiangqiang/.ssh/id_rsa.
Your public key has been saved in /Users/yinqiangqiang/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:8QPUtJr5g4NCKiwJXHkYQ7V27NjZmMQF9Md0N/2edKs yinqiangqiang@yinqianangdeMBP
The key's randomart image is:
+---[RSA 2048]----+
| .+...oo+.. . o.|
| = +.o +.. . o|
| + + =o..o .|
|. . o * =B. .o|
|.. .. *S.o ..+|
|o. o . o . o.|
|+.. . . o o . |
|.. . . . E |
| |
+----[SHA256]-----+
生成成功,然后 打开,由于这是一个隐藏文件。所以用终端打开比较方便
3、打开:
$ ls -a ~/.ssh
显示:
. ..
id_rsa id_rsa.pub
known_hosts
生成成功。
这个id_rsa.pub 就是我们要得到的公钥。
相关文章推荐
- Linux(mac) 系统 ssh 不能生成key错误处理
- 在windows,mac,linux下 git ssh key的生成
- Mac系统Git生成ssh公钥
- 之前生成的.ssh可以直接放入Mac系统user/your_name中使用
- mac 生成 ssh-key
- mac 生成 ssh-key
- Mac系统Git生成ssh公钥
- windows,linux,mac生成ssh public key 和 private key
- Mac OS X系统生成ssh公私钥
- Linux或者Mac系统使用SSH连接树莓派
- Git SSH Key 生成步骤
- Mac系统下Android生成keystore
- iConvert Icons 图标转换生成利器,支持Windows, Mac OS X, Linux, iOS,和Android等系统
- Linux或者Mac系统使用SSH连接树莓派
- 如何使用ssh-keygen生成key
- Gitblit Git 无密码 clone pull SSH Key 生成
- Git SSH Key 生成步骤
- lstat(/etc/ssh/ssh_host_ecdsa_key.pub) failed
- ssh git key 的生成与覆盖