简体   繁体   English

如何修复Windows上git配置中的“ ssh权限被拒绝,请重试错误”

[英]How to fix “ssh permission denied please try again error” in git configuration on Windows

I am trying to configure git server and client on two local windows machines. 我正在尝试在两台本地Windows计算机上配置git服务器和客户端。 I installed git software on both the machines. 我在两台机器上都安装了git软件。 Enabled openssh server optional feature on the server and created a bare repository on the server. 在服务器上启用了openssh服务器可选功能,并在服务器上创建了裸存储库。 Then tried to clone the server's bare repository on the client, it asked me the password of the server's user but, even after I entered the right password it was giving the below error message. 然后尝试在客户端上克隆服务器的裸存储库,它询问我服务器用户的密码,但是即使输入正确的密码,它也会给出以下错误消息。

Permission denied (publickey,password,keyboard-interactive). 权限被拒绝(公钥,密码,键盘交互)。

I have tried to figure out the cause for the error. 我试图找出错误的原因。 After browsing for this error on google I got to know that it is ssh not configured properly. 在google上浏览此错误后,我知道它的ssh配置不正确。 One suggestion I found was to check if ssh working properly without git involvement using the command 我发现的一个建议是使用该命令检查ssh是否在没有git参与的情况下正常运行

ssh -Tv ram-pc1@10.208.27.100, it also failed by giving below error message: ssh -Tv ram-pc1@10.208.27.100,它也由于给出以下错误消息而失败:

$ ssh -Tv ram-pc1@10.208.27.100 $ ssh-电视ram-pc1@10.208.27.100

OpenSSH_7.7p1, OpenSSL 1.0.2p  14 Aug 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 10.208.27.100 [10.208.27.100] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Admin/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/Admin/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.6
debug1: match: OpenSSH_for_Windows_7.6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.208.27.100:22 as 'ram-pc1'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
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: ecdsa-sha2-nistp256 SHA256:27NSp0TODhiZ68zbYLvsaqPNMp8tE0ZanMeoeQp+u14
debug1: Host '10.208.27.100' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/Admin/.ssh/known_hosts:1
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_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:2KyRU6bbWWkN+IBYN6xiuWQuHl0pKL6Cim6K4/6RBek /c/Users/Admin/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /c/Users/Admin/.ssh/id_dsa
debug1: Trying private key: /c/Users/Admin/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/Admin/.ssh/id_ed25519
debug1: Trying private key: /c/Users/Admin/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
ram-pc1@10.208.27.100's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
ram-pc1@10.208.27.100's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
ram-pc1@10.208.27.100's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: No more authentication methods to try.
ram-pc1@10.208.27.100: Permission denied (publickey,password,keyboard-interactive).

Below is my ssh_config file settings: 以下是我的ssh_config文件设置:

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile  .ssh/authorized_keys

#AuthorizedPrincipalsFile none

# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem   sftp    sftp-server.exe

# Example of overriding settings on a per-user basis
#Match User anoncvs
#   AllowTcpForwarding no
#   PermitTTY no
#   ForceCommand cvs server

I have spent a lot of time to resolve this error. 我花了很多时间解决此错误。 But not succeeded. 但是没有成功。 Please help in solving this problem. 请帮助解决这个问题。 Thanks in advance. 提前致谢。

Check the content of ~ram-pc1/.ssh/authorized_keys on the 10.208.27.100 server side: it should include your public key. 在服务器10.208.27.100上检查〜ram-pc1 / .ssh / authorized_keys的内容:它应包含您的公钥。

Said public key should be an rsa one (without passphrase for now) named C:\\Users\\Admin\\.ssh\\id_rsa.pub (and id_rsa for the private) key, generated with ssh-keygen -t rsa -P "" 所述公用密钥应该是一个rsa密钥(暂时没有密码),名为C:\\Users\\Admin\\.ssh\\id_rsa.pub (对于私有密钥,则为id_rsa),它是使用ssh-keygen -t rsa -P ""

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 权限被拒绝:稍后在 ssh 中重试错误 - Permission denied :try again later error in ssh 使用 ssh-keygen 创建 ssh 密钥时权限被拒绝 - Permission denied while creating ssh key using ssh-keygen Git bash Windows 10 Enterprise 尽管 SSH 身份验证有效,但 Git 的权限被拒绝 - Permission denied to Git despite valid SSH authentication 如何在 Windows 上的 Sublime Text 3 中修复“权限被拒绝 collect2.exe:错误:ld 返回 1 个退出状态” - how to Fix "Permission denied collect2.exe: error: ld returned 1 exit status" in Sublime Text 3 on Windows 从 PostgreSQL 中的文件(在 Windows 中)执行 SQL 命令时,如何修复“权限被拒绝”错误? - How to fix“Permission denied” error when executing SQL command from a file in PostgreSQL (in Windows)? Windows 上的 Git [权限被拒绝(公钥)] 的 Jenkins 问题 - Jenkins issue with Git [Permission denied (publickey).] on Windows 使用 SSH 从 Windows 连接到远程 linux 机器时出现权限被拒绝错误 - Connecting to a remote linux machine from windows using SSH give permission denied error 对于 ssh 连接,在 Anaconda、Windows 中出现错误“无法加载密钥 ----,格式无效,权限被拒绝(公钥)” - For ssh connection, getting error "Failed to load key ----, invalid format, Permission denied (publickey)" in Anaconda, Windows Git 配置上 windows 用于 ssh 访问 ZE1ADBCBB92C622D0B3E619F9D0703 - Git configuration on windows for ssh access to Github 如何在没有权限拒绝错误的情况下在 Windows 路径上安装 virtualenv? - How to install virtualenv on windows path without permission denied error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM