git - gitlab: Windows: How to use chmod and fix "Get Permission denied (publickey). fatal: Could not read from remote repository" -
i have gone through many other posts above error, seem different os, or different reason.
i running windows 8.1. have git installed (i new git), , have signed gitlab, create project there, created , added key (as per instructions), when try , push,
pushing git@gitlab.com:myusername/test1.git permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists.
now when created ssh key using
ssh-keygen -t rsa -c "myemail@gmail.com
it did create files in local project folder, , not under c:\users\peter (my home folder)
so, copied single file (known_hosts) deleted existing .ssh folder, , created using bash, , copied in above created id_rsa.pub , idrsa.key files.
from git gui, if go | show ssh key reports "found public key in ~/.ssh/id_ras.pub
from bash, permissions on folder are.
drwxr-xr-x 1 peter administ 0 jun 14 09:35 .ssh
and permissions on files within are..
$ ls .ssh -l total 2 -rw-r--r-- 1 peter administ 403 jun 13 18:26 id_rsa.pub -rw-r--r-- 1 peter administ 1766 jun 13 18:26 idrsa.key -rw-r--r-- 1 peter administ 184 jun 13 18:11 known_hosts
i assuming need fix permissions here?
so go .ssh folder , try chmod 777 *
but when use ls -l see permissions have not changed
likewise when try on actual directory .ssh, permissions stay are
so, questions are
- am on right track here, permissions of folder/files problem
- if so, how can fix (on windows 8.1)
i @ complete loss of try next
thanks in advance help!
am on right track here, permissions of folder/files problem
not really: "permission denied" sent gitlab server, doesn't recognize ssh public key.
firstly, mentioned in gitlab ssh keys doc page:
copy-paste key (
id_rsa.pub
content) 'my ssh keys' section under 'ssh' tab in user profile. please copy complete key starting ssh- , ending username , host.
secondly, ssh locally private , public keys in %home%
.
, %home%
isn't defined default in git, unless launch git-cmd.exe
or git-bash.exe
packaged latest git windows 2.4.x+.
so:
- make sure grep portablegit-2.4.3.1-2nd-release-candidate-64-bit.7z.exe, , unzip anywhere want (for example in: c:\prgs\git\portablegit-2.4.3.1-2nd-release-candidate-64-bit)
don't intall old obsolete msysgit 1.9.5 git-scm.com. i explained, phased out. - add
c:\prgs\git\portablegit-2.4.3.1-2nd-release-candidate-64-bit\usr\bin
%path% (it includesssh.exe
) - launch
c:\prgs\git\portablegit-2.4.3.1-2nd-release-candidate-64-bit\git-cmd.exe
, , see%home%
define (set home
).
should defined%userprofile%
default (c:\users\<yourlogin>
) - generate ssh keys (or copy existing 1 in
%home%\.ssh
). don't worry chmod or rights. - make sure ssh public key copied in gitlab ssh key page.
then, test if ssh works:
ssh -tv git@gitlab.com
now can start pushing.
Comments
Post a Comment