好的伙计们,这里是菜鸟 RSA 问题。
我有一个生产服务器,我在那里生成了一个 rsa 密钥。然后我将公钥 (id_rsa.pub) 交给 github,作为我相信的部署密钥。
我想要做的是自动化一个部署脚本,该脚本将在服务器上运行“git pull”。但是,每次我运行 'git pull' 时,它都会询问我的密码。
有什么办法可以让它不每次都要求输入密码?具体线路是:
Enter passphrase for key '~/.ssh/id_rsa':
Run Code Online (Sandbox Code Playgroud)
我在这里误解了什么吗?
我注意到https://github.com/apache/ant说“从 git://git.apache.org/ant.git 镜像”(带有链接),我也想这样做。
https://exyr.org/2011/git-mirrors/似乎是对一般技术(基本上是一个 cron 工作)的好文章,但我遇到了一些奇怪的错误,我没有看到“镜像来自” https://github.com/pdurbin/openscholar(目的地)。我希望镜像的来源是https://github.com/openscholar/openscholar
这是我看到的(修剪后的)输出:
murphy:~ pdurbin$ cd /tmp
murphy:tmp pdurbin$ git clone --mirror https://github.com/openscholar/openscholar.git
Cloning into bare repository 'openscholar.git'...
remote: Counting objects: 167069, done.
remote: Compressing objects: 100% (51806/51806), done.
remote: Total 167069 (delta 112936), reused 166304 (delta 112255)
Receiving objects: 100% (167069/167069), 82.77 MiB | 650 KiB/s, done.
Resolving deltas: 100% (112936/112936), done.
murphy:tmp pdurbin$ cd openscholar.git
murphy:openscholar.git pdurbin$ git remote add github git@github.com:pdurbin/openscholar.git
murphy:openscholar.git pdurbin$ git fetch -q && …Run Code Online (Sandbox Code Playgroud) 当我在 VirtualBox 中登录到我的 Ubuntu 服务器时,下面出现这条消息“无法连接到 https://changelogs.ubuntu.com/meta-release-lts。请检查您的 Internet 连接或代理设置”是因为我使用了命令git config --global --unset https.proxy ?. 我使用了这个命令,因为我在克隆 github 存储库时遇到了问题,它说致命的无法访问:无法解析主机:github.com
我该如何解决这个问题?
假设您有一个 Git 存储库,就像在 GitHub 上一样,并且有很多人为该存储库做出贡献。每个人都使用自己的编码标准,因此如果没有应用任何标准,代码最终会变得一团糟。
我读过一些关于 git hooks 的内容,但我不完全理解它们的概念或主要用途。
当拉取请求发送到您的存储库时,是否可以使用挂钩将代码发送到某个远程服务,然后将代码格式化为您想要使用的任何 XYZ 标准,然后将格式化的代码返回到回购还是拉入请求?或者它不是那样工作的?
像大多数其他人一样,我们的存储库服务器需要尽快禁用 SSLv3(和 v2)。
然而,这样做似乎破坏了我们的 git 客户端——至少,在 RHEL5 上(来自我的 FreeBSD 桌面的连接工作正常)。即使是最新的 git (2.1.2) 也失败了,将 OpenSSL 库升级到供应商的最新版本也无济于事。
然而!相同的 git-client 对 github.com 工作得很好——而且 github.com 也已经禁用了 SSLv3。通过反复试验,我将我们服务器的(Apache)SSL 配置设置为与 github 的配置相匹配:
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite "AES128-SHA AES256-SHA RC4-SHA"
Run Code Online (Sandbox Code Playgroud)
通过sslscan在我们的服务器和 github 上运行,我得到了接受和拒绝的相同密码列表。但是 git 继续失败:
% git clone https://git.example.net/git/puppet-hiera
Cloning into 'puppet-hiera'...
* Couldn't find host git.example.net in the .netrc file, using defaults
* About to connect() to git.example.net port 443
* Trying 10.89.8.27... * connected
* Connected to git.example.net (10.89.8.27) …Run Code Online (Sandbox Code Playgroud) 我已经从 Puppet Forge安装了camptocamp/nagios,但它似乎依赖于在 GitHub 上发布的puppet-apache_c2c。
我已经按照建议安装了 nagios 模块:
puppet module install camptocamp-nagios
Run Code Online (Sandbox Code Playgroud)
但是,如何安装缺少的依赖项?
我已经看到一些JIRA 票据可以提供这种能力,但是它似乎还没有实现(状态:准备好进行工程)。那么现在有什么解决方法吗?安装非 puppet-forge 模块的正确方法是什么?
我有我的 github 帐户,我想从我的两个工作站访问它,一个 Ubuntu 工作站和一个 Windows 工作站。
我也是 SSH 和 git 的初学者,我按照所有说明在我的 ubuntu 笔记本电脑上使用 SSH 密钥设置我的帐户,一切正常,但是现在如果我想从我的 Windows 笔记本电脑使用我的 git 帐户,我需要生成另一个 ssh 密钥,或者我可以使用从我的 ubuntu 笔记本电脑生成的密钥?
也许我需要从我的 Windows 笔记本电脑生成另一个 ssh 密钥,然后用我的 github 帐户注册它以及我从我的 ubuntu 笔记本电脑生成的一个,并在各自的机器上使用每个?
最好的方法是什么?有最佳实践吗?
如果我可以在两台机器上使用相同的 SSH 密钥,我如何导入我已经在另一台机器上使用的密钥?
我有一种情况,我需要使用两个不同的 SSH 密钥访问同一个 SSH 主机 (GitHub)。这没问题,我可以通过为主机名设置别名来轻松设置它。当此配置与我的 SSH 多路复用配置结合时,问题就来了。我似乎无法使用特定于主机的声明覆盖我的默认 ControlPath。
也许这只是它的工作方式?也许这是一个错误?难道我做错了什么?
顺便说一下,我使用的是 Mac 10.7。
这是我的配置:
Host *
ControlMaster auto
ControlPath ~/.ssh/connections/ssh-%r@%h:%p
Host github.com-X
TCPKeepAlive yes
ServerAliveInterval 60
ControlPersist 1h
Hostname github.com
User git
IdentityFile ~/.ssh/id_rsa_X
IdentitiesOnly yes
ControlPath ~/.ssh/connections/ssh-%r@%h-X:%p
Host github.com
TCPKeepAlive yes
ServerAliveInterval 60
ControlPersist 1h
Run Code Online (Sandbox Code Playgroud)
我稍微修改了一下,但似乎我总是得到 Host * 声明中指定的 ControlPath。
ssh -T git@github.com-X
Run Code Online (Sandbox Code Playgroud)
使用 id_rsa_X 以正确的用户身份登录我,但它会在此处创建域套接字:
~/.ssh/connections/ssh-git@github.com:22
Run Code Online (Sandbox Code Playgroud)
而不是:
~/.ssh/connections/ssh-git@github.com-X:22
Run Code Online (Sandbox Code Playgroud)
所以稍后当我尝试使用 id_rsa 发出 SSH 命令时,由于连接多路复用,我得到了 id_rsa_X 用户。换句话说:
ssh -T git@github.com
Run Code Online (Sandbox Code Playgroud)
为密钥为 id_rsa_X 的用户给我一条问候消息。
有任何想法吗?
编辑:对 vgoff 评论的回应——不,它似乎正在阅读我的所有配置......
$ ssh -vT …Run Code Online (Sandbox Code Playgroud) 我今天遇到了一个问题,由于与 github 的连接问题,我在应用服务器上的部署无法完成。
我注意到,当我使用谷歌 DNS 服务器对 github.com 进行 DNS 查找时,我得到了“正确/旧”的 IP 地址,guthub HERE也正式记录了这些地址。
root@server# host github.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
github.com has address 192.30.253.112
github.com has address 192.30.253.113
github.com mail is handled by 10 ALT4.ASPMX.L.GOOGLE.com.
github.com mail is handled by 10 ALT3.ASPMX.L.GOOGLE.com.
github.com mail is handled by 5 ALT1.ASPMX.L.GOOGLE.com.
github.com mail is handled by 1 ASPMX.L.GOOGLE.com.
github.com mail is handled by 5 ALT2.ASPMX.L.GOOGLE.com.
Run Code Online (Sandbox Code Playgroud)
但是,当我使用我的托管服务提供商 DNS 服务器时,我得到了不同的结果:
root@server# host github.com 213.133.98.98
Using domain server:
Name: …Run Code Online (Sandbox Code Playgroud) github ×10
git ×5
ssh ×2
curl ×1
installation ×1
ip-address ×1
mirror ×1
mod-ssl ×1
puppet ×1
rsa ×1
ssh-keys ×1
ssl ×1
svn ×1
ubuntu ×1
virtualbox ×1