Windows(Ubuntu)下GitBash生成public ssh key
来源:互联网 发布:淘宝商品自检 编辑:程序博客网 时间:2024/05/14 00:05
SSH目前是Unix和Linux上用于加密连接远程服务器的命令行工具。不仅是Windows用户将能够使用OpenSSH连接远程服务器,Windows系统本身也将运行一个服务来允许远程设备进行连接.
Windows
切换到C:\Users\<username>\.ssh
执行命令:ssh-keygen -t rsa -C "邮箱地址"
Generating public/private rsa key pair.
Enter file in which to save the key (//.ssh/id_rsa):
第一次生成由于没有id_rsa文件和id_rsa.pub文件,所以需要生成这两个文件,然后手动输入:./id_rsa
Enter file in which to save the key (//.ssh/id_rsa): ./id_rsa,虽然要求输入//.ssh/id_rsa,但这种方式不是在当前目录下
接下来两部是要求输入密码,不输入直接回车就完成了。
justbecause@DESKTOP-Q2PDR14 .ssh $ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/justbecause/.ssh/id_rsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again:
Your identification has been saved in /c/Users/justbecause/.ssh/id_rsa.
Your public key has been saved in /c/Users/justbecause/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:6lguUfZeTIdIDfwt6cpArBQ5cuS+jWatOUYs0Cx9R7g justbecause@DESKTOP-Q2PDR14
The key's randomart image is:
+---[RSA 2048]----+
| ..o ..o |
| ..* . o . |
| + o.* . o + |
|o +.E * . * o |
| o +.* .S+ o |
| . ==... + |
| o=.=+ o |
| o+B + |
| .+oo |
+----[SHA256]-----+
justbecause@DESKTOP-Q2PDR14 .ssh $ ls
id_rsa id_rsa.pub known_hosts
justbecause@DESKTOP-Q2PDR14 .ssh $
C:\Users\yang\.SSH\id_rsa.pub
复制代码到:http://122.204.161.96:18099/profile/keys/42 Add SSH Key
Ubuntu 下解决办法
(1) lyt@lyt-machine:~$ ssh-keygen -t rsa -C "yh_hzsd@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/lyt/.ssh/id_rsa): 《Enter》
Enter passphrase (empty for no passphrase):
Generating public/private rsa key pair.
Enter file in which to save the key (/home/lyt/.ssh/id_rsa): 《Enter》
Enter passphrase (empty for no passphrase):
【在ubuntu下以点开头命名的文件和文件夹是隐藏的,进入自己主目录,按ctrl+h.就能看见以点号开头的隐藏文件,有些文件因 为权限问题无法编辑,打开终端输入sudo nautilus,会出现超级用户文件夹,就能编辑任何文件】
(2) 然后将生成的id_rsa.pub的内容原封不动复制代码到:http://122.204.161.96:18099/profile/keys/42 Add SSH Key
结果报错了:fatal: 'server' does not appear to be a git repository
fatal: Could not read from remote repository
Please make sure you have the correct access rights
and the repository exists.【百思不得其解,结果是 vi .git/config 没配置】
(3) [core]
repositoryformatversion = 0
[remote "origin"]filemode = truebare = falselogallrefupdates = true
url = git@122.204.161.96:yangheng/ccnu_edx.git
[remote "server"] (此行是复制过来的)fetch = +refs/heads/*:refs/remotes/origin/*
url = git@122.204.161.96:xuxiao/ccnu_edx.git
[branch "develop"]fetch = +refs/heads/*:refs/remotes/server/*
remote = origin
merge = refs/heads/develop
0 0
- Windows(Ubuntu)下GitBash生成public ssh key
- Windows下利用GitBash生成public ssh key
- Windows上利用GitBash生成public ssh key
- git:如何生成git ssh key(windows下)
- windows下生成github ssh key详解
- windows下生成github ssh key详解
- windows下生成github ssh key详解
- windows下生成github ssh key详解
- 在windows,mac,linux下 git ssh key的生成
- Windows环境下生成SSH key且连接GitHub
- windows下生成ssh key并上传到gitlab
- windows下git库的ssh连接,使用public key的方法
- Linux下SSH-KEY生成
- SSH Public Key Authentication
- shell 生成public key,实现免密码SSH登录
- linux相关-ubuntu使用ssh public key登陆
- Win7下生成SSH Key连接Github--(MsysGit)
- windows7下git生成ssh key
- AlertDialog ——简单对话框
- Android界面技巧:当输入法调出时,如何让界面自动上移,使输入法不会遮挡到主界面(Activity)
- java servlet 过滤器
- 【BZOJ】2060: [Usaco2010 Nov]Visiting Cows 拜访奶牛
- 嵌入式开发学习路线图
- Windows(Ubuntu)下GitBash生成public ssh key
- UITextField设置文字偏移的效果
- C语言,可变参数列表
- vue.js 学习——起步
- 选择和评测Linux VPS/服务器可采用的9个检测方法/工具
- Elasticsearch Term查询
- 程序设计与算法 第五周测验
- POJ 3067 Japan(经典树状数组)
- android 点9图片