- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这只是关于 git 如何运行的一般问题。我在 git 手册中找不到与此相关的任何内容,也许我没有找对地方。
当您使用来自 git 服务器的 ssh 链接进行克隆时,它使用的用户名是 git,而不是您尝试使用的 key 的用户名。为什么 git 这样做以及 git 如何判断它应该使用哪个 key 对来验证连接。
最佳答案
When you clone using an ssh link from a git server, the username it uses is git, not the username of the key you are trying to use.
authorized_keys
来完成。 Git 用户的文件,Gerrit 或 Gitolite 等工具会在您添加和删除用户时管理该文件。 authorized_keys 文件允许指定在经过身份验证时运行的特定命令,并且这些工具使用该功能与用户交流 - 然后应用程序从那里确定权限。
Why does git do this and how is git able to tell which keypair that it should use to authenticate the connection.
~/.ssh/config
中指定它。 (这是我做的),或者你让
ssh
遍历可用的键并弄清楚。如果管理员设置了严格的规则,后者可能会导致问题,因为任何不起作用的 key 都将被视为身份验证尝试。大多数人没有超过一把 key ,所以一般来说这不是问题。
ssh -v git@github.com
来查看其中的一些协商。 ,或您要针对的任何服务器:
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/jszakmeister/.ssh/config
debug1: /Users/jszakmeister/.ssh/config line 286: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Control socket "/tmp/git@github.com:22" does not exist
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: Connection established.
debug1: identity file /Users/jszakmeister/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jszakmeister/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version libssh_0.7.0
debug1: no match: libssh_0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/jszakmeister/.ssh/known_hosts:25
Warning: Permanently added the RSA host key for IP address '192.30.255.113' to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/jszakmeister/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.255.113]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
PTY allocation request failed on channel 0
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi jszakmeister! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
Transferred: sent 2988, received 1868 bytes, in 0.2 seconds
Bytes per second: sent 19242.2, received 12029.6
debug1: Exit status 1
我不确定这是否完全回答了您的问题,但我希望它有所帮助。
Host gh
User git
Hostname github.com
IdentityFile ~/.ssh/id_github
你可以使用类似上面的方法来允许
git clone gh:foo/bar.git
本质上是指
git clone git@github.com:foo/bar.git
并使用不同的 SSH key 进行身份验证。我一直都在使用这个功能,而不仅仅是与 Git 相关的东西。
关于git - 为什么git使用ssh使用git作为用户名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47664768/
我想做的是从 table1 中获取 usernames 和 picURLs WHERE usernames = all the usernames from this query (从表 2 中选择用
我使用字符串“username”作为表的主键, 但是,当保存并获取具有用户名ID的列时,我希望忽略这种情况,以使新用户无法尝试模拟其他用户。 ,例如注册新用户时 用户名=达克森 用户名= DaXoN
在 ReportManager 中,我有很多用户提示这个错误。当我筛选 RS 日志时,我多次看到不同用户的以下错误: session!ReportServer_0-2!1e40!04/20/2011-
我是 Node js新手,我正在尝试将MySql与 Node 连接的示例。当我运行代码时,我得到 Error while performing Query.Error: ER_ACCESS_DENIE
收集整理了15个常用的javaScript正则表达式,其中包括用户名、密码强度、整数、数字、电子邮件地址(Email)、手机号码、身份证号、URL地址、 IPv4地址、 十六进制颜色、 日期、 QQ
我正在做一个需要以下内容的项目。 服务器端的 WCF 服务 (.NET 3.5) 客户端的 WPF 客户端 (.NET 3.0) 我有一个现有的应用程序,我必须使用(在服务器端)的身份验证和授权。我还
用户名,密码和电子邮件的标准最小和最大长度是多少? 最佳答案 我对此问题有疑问,因为它预先假设应该有一个标准,并且所有服务的值都应该相同。 我认为为这些字段中的任何一个(例如密码字段)加上最大长度是没
我看到in the standard我可以拥有 autocomplete要么等于 username或 email在输入字段上。 就我而言,用户名实际上是用户的电子邮件。 什么是最好的autocompl
我正在尝试编写一些网站代码并创建用户名和密码。我不知道这是否完全合乎逻辑,或者即使代码已修复,它是否仍能工作,但我是一个初学者,我正在从零开始工作。这是我所拥有的: alert("Welcome.
我想使用ncat编写一个简单的bash脚本,以打开与ISP及其端口的连接。 第一个命令是: nc address port 完成此操作后,首先提示我提供一个用户名。我必须按ENTER键,然后提示我提供
我收到此错误是因为我创建了一个自定义用户模型,并且在完成所有设置后(将其设置为django / contrib / auth / models.py),我将电子邮件设置为USERNAME_FIELD,
我有 3 台 Windows 7 Professional 机器。两台被设置为安装了 Git 的开发机器(一台台式机和一台笔记本电脑)。第三个是设置为安装了 Git 的文件服务器,并且它还作为 ssh
def login(): UserName = input("Please enter your username: ") passw = input("Please enter yo
我正在 Kivy 中创建一个应用程序。我正在创建一个登录页面,允许用户输入密码和用户名,以验证他们以前是否使用过我的应用程序。我将用户名和密码存储在名为“users”的 MySQL 数据库中,该表称为
什么是 Mysql 查询 REGEXP 来调用它? @text @user_name @4ll_r1ght @last2 @_last1 @and1more_ 最佳答案 SELECT * FROM u
我在寻找用户名和电子邮件垃圾邮件列表。当用户尝试注册时,我想检查他们输入的用户名或电子邮件是否在用户名/电子邮件垃圾邮件列表中,如果是,则将帐户标记为可疑垃圾邮件并手动验证成员资格。 它背后的后端不是
你好, 我被一个小问题困住了, 我需要允许 muplite 用户能够登录 我的 php 代码与一个成员一起工作,我怎样才能让多个用户可以登录, 如果有更好的使用 MySql 的方法请告诉我 $
是否有一组在编译时创建的定义,我可以使用它们来填充 printk 语句,其中包含有关在哪里以及谁最后构建内核驱动程序的信息?我知道有预定义的 C 宏,我希望在那里找到一些在编译开始时动态设置的东西,但
我正在为我正在开发的网站创建登录脚本。目前,我已将用户名和密码硬编码到脚本中。即 $usersAndPasses = array( 'username1' => 'password1',
我想像这样从成员列表页面收集用户名: http://www.marksdailyapple.com/forum/memberslist/ 我想从所有页面中获取每个用户名, 我想在 linux 中用 b
我是一名优秀的程序员,十分优秀!