我的mac出了问题,我无法在磁盘上保存任何类型的文件.我不得不重新启动OSX lion并重置文件和acls的权限.
但是现在当我想提交存储库时,我从ssh得到以下错误:
Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
Run Code Online (Sandbox Code Playgroud)
我应该为id_rsa文件提供哪些权限级别?
我遇到了这个错误:
$ git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter.
Run Code Online (Sandbox Code Playgroud)
我试图添加密钥,我在下面收到此错误:
$ ssh-add ~/.ssh/id_rsa.pub
Could not open a connection to your authentication agent.
Run Code Online (Sandbox Code Playgroud) 我想使用多个私钥连接到不同的服务器或同一服务器的不同部分(我的用途是服务器的系统管理,Git的管理,以及同一服务器内的正常Git使用).我试过简单地将id_rsa文件中的密钥堆叠起来无济于事.
显然,一种直接的方法是使用该命令
ssh -i <key location> login@server.example.com
Run Code Online (Sandbox Code Playgroud)
这非常麻烦.
关于如何更轻松地做这件事的任何建议?
我能够通过HTTPS身份验证克隆此repo的副本.我做了一些提交,想要推回到GitHub服务器.在Windows 7 x64上使用Cygwin.
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
error: The requested URL returned error: 403 while accessing https://MichaelDrog
alis@github.com/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
同时使用详细模式进行设置.我还是很困惑.
C:\cygwin\home\XPherior\Code\lunch_call>set GIT_CURL_VERBOSE=1
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL …Run Code Online (Sandbox Code Playgroud) 我有以下用例:我希望能够推送git@git.company.com:gitolite-admin使用用户的私钥gitolite-admin,而我想推送git@git.company.com:some_repo使用"我自己的"私钥.AFAIK,我无法解决这个问题~/.ssh/config,因为在这两种情况下用户名和服务器名都是相同的.由于我主要使用自己的私钥,因此我已将其定义~/.ssh/config为git@git.company.com.有没有人知道一种方法来覆盖用于单个git调用的密钥?
(旁白:gitolite基于密钥来区分谁在进行推送,因此在访问,所有权和审计方面,用户@服务器字符串对于不同的用户来说是相同的.)
我有2个Git服务器,需要2个不同的SSH密钥.
git clone user1@server1:blahblahblah使用~/.ssh/id_rsa,但我需要根据我连接的服务器指定使用哪个密钥.
什么Git命令行参数完成这项工作?(我正在运行Linux)
我想更新git clone上的子模块.
有没有办法用Jenkins管道Git命令做到这一点?
目前我正在这样做......
git branch: 'master',
credentialsId: 'bitbucket',
url: 'ssh://bitbucket.org/hello.git'
Run Code Online (Sandbox Code Playgroud)
但是,一旦克隆,它就不会更新子模块
我可以访问可以访问GIT服务器的SSH帐户,并且能够在此SSH登录中克隆/推送/拉取存储库.但是,我无法从其他地方访问此回购.
在我使用的SSH帐户上,
git clone git@gitserver:proj/myrepo.git
Run Code Online (Sandbox Code Playgroud)
克隆回购.
我尝试使用其他机器设置到git服务器的ssh隧道,
ssh -L 3333:gitserver:22 userid@sshserver
git clone ssh://localhost:3333/proj/repo.git
Run Code Online (Sandbox Code Playgroud)
但是我不断收到用户'git'的密码提示.我在这里做错了什么想法?
我正在尝试创建一个Ansible playbook,它将从我们的开发团队计算机和CI/CD服务器运行.
该手册中的任务之一是从私有git存储库获取我们项目的源代码.由于剧本必须从CI/CD服务器运行,我们无法使用SSH转发.
我想到的是将必要的SSH私钥复制到远程主机,然后使用密钥克隆来自私有git存储库的代码.
但是在尝试此操作时,克隆任务会挂起.尝试手动启动命令时,它会要求输入SSH私钥的密码.SSH密钥不使用密码(空白).
任何人都可以分享这个(可能非常常见的)问题的解决方案吗?
如果有人需要,这是我目前的剧本:
- name: Create SSH directory
file: path=/root/.ssh state=directory
- name: Copy SHH key for Git access
copy:
content: "{{ git_ssh_key }}"
dest: /root/.ssh/id_rsa
owner: root
group: root
mode: 0600
# Also tried this, but it also hangs
#- name: Start SSH agent and add SSH key
# shell: eval `ssh-agent -s` && ssh-add
- name: Get new source from GIT
git:
key_file: /root/.ssh/id_rsa
repo: "git@gitlab.com:user/repo.git"
dest: "{{ staging_dir }}"
depth: 1
accept_hostkey: yes …Run Code Online (Sandbox Code Playgroud) 是否有可能访问(fetch/ push)使用ssh和身份文件(私钥),而不添加文件条目中的远程仓库~/.ssh/config,例如:
Host tingle
HostName 111.222.333.444
User git
IdentityFile c/tmp/my_id_rsa
Run Code Online (Sandbox Code Playgroud)
配置~/.ssh/config文件时一切正常.但是我们有一个脚本,它从远程仓库克隆,检出,开始测试,提交结果并推送它们.该脚本需要在任何计算机上运行,而无需触及ssh配置文件.
git ×7
ssh ×7
ansible ×1
ansible-2.x ×1
config ×1
dvcs ×1
github ×1
gitolite ×1
jenkins ×1
openssh ×1
permissions ×1
ssh-agent ×1
ssh-keys ×1
ssh-tunnel ×1