[英]Can't match ssh key for git. Makes local fingerprint instead?
My target is to set up git on my Linux server box so I can commit/push through a batch file from my windows machine. 我的目标是在Linux服务器上设置git,以便可以从Windows机器上提交/推送批处理文件。 I was hoping for something similar to how I did it with svn in the past, such that I could create a user that had certain read/write privileges.
我希望获得类似于过去使用svn的方式,以便我可以创建一个具有某些读/写权限的用户。 I am more than happy for it to be ssh key dependant.
我非常高兴能成为ssh key的依赖者。 Thus far every time I try to put an ssh key on my computer and on the server, it just ignores it and makes its own:
到目前为止,每次我尝试将ssh密钥放在计算机和服务器上时,它只会忽略它并自己创建:
The authenticity of host 'xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Are you sure you want to continue connecting (yes/no)?
And this means I have to insert a password every time so my batch file solution won't work. 这意味着我每次都必须输入密码,这样我的批处理文件解决方案将无法使用。
I placed the key on my windows machine both in "C:/Users/Ryan/.ssh/" and "C:/Program Files (x86)/Git/.ssh/" in the msysgit installation directory. 我将密钥放在msysgit安装目录中的“ C:/Users/Ryan/.ssh/”和“ C:/ Program Files(x86)/Git/.ssh/”中的Windows计算机上。 I also installed it onto my server to the suggested git user.
我还将它安装到建议的git用户的服务器上。 I did the basic installation following the git documentation : - Generated myself an SSH key using puttygen.
我按照git文档进行了基本安装:-使用puttygen为自己生成了一个SSH密钥。 - Copied it to my server and cat'd it to authorized_keys in /home/git/.ssh/ - Init'd bare git repository etc.
-将其复制到我的服务器,并将其分类到/home/git/.ssh/中的authorized_keys-初始化裸git存储库等。
I can push/pull but I have to use the RSA fingerprint and use the git account password to log in rather than using an ssh key. 我可以推/拉,但是我必须使用RSA指纹并使用git帐户密码登录,而不是使用ssh密钥。
Am I doing something wrong is it actually supposed to work like this? 我是在做错什么吗,实际上应该是这样工作的吗?
I haven't fully read into making a git daemon instead, perhaps that is what I am after? 我还没有完全读懂制作git守护进程,也许那是我所追求的?
Make sure you are starting a DOS session with git-cmd.bat
from your msysgit distribution: that will set the HOME
environment variable properly (usually %USERPROFILE%
). 确保从msysgit发行版的
git-cmd.bat
启动DOS会话:这将正确设置HOME
环境变量(通常为%USERPROFILE%
)。
The public ( id_rsa.pub
) and private ( id_rsa
) keys need to be in %HOME%\\.ssh
. 公钥(
id_rsa.pub
)和私钥( id_rsa
)必须位于%HOME%\\.ssh
。
The message The authenticity of host
should only occurs one, at the first ssh connection. 消息
The authenticity of host
应该只在第一个ssh连接中出现一次。 Once it is done, don't delete the %HOME%\\.ssh\\known_hosts
file it has created. 完成后,请勿删除它创建的
%HOME%\\.ssh\\known_hosts
文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.