When i run this on mac, everything is ok :
git clone [email protected]:my_project
When i run it at home and copied my home id_rsa.pub key to ssh project in authorized_keys , ssh connection is ok, but cloning git repo requires password, why?
Full steps to reproduce:
git config --global user.name 'User Surname'
git config --global user.email '[email protected]'
ls -al ~/.ssh # shows nothing
ssh-keygen -t rsa -C "[email protected]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
Paste id_rsa.pub from cliboard to github account -> settings -> ssh keys -> add and press enter, it added successfully
ssh -T [email protected]
Hi user! You've successfully authenticated, but GitHub does not provide shell access. Paste the same id_rsa.pub to evernote
From my working mac, copy it from evernote, and connect to ssh:
ssh [email protected]
ee ~/.ssh/authorized_keys
Paste id_rsa from evernote in end of file and save file.
cd my-rails-app/repo
git ls-remote
Copy part of first string from stdout:
From [email protected]:my_project
Connect to ssh from home asus
ssh [email protected]
everything is ok
git clone [email protected]:my_project
-> required password
~/.sshdefault location. You can see this by running inGit Bashthe commandssh-keygen. If your default location is not/c/Users/<your user name>/.ssh/id_rsathan you shoud look atEnviromental variablesto see if some variable is changing.sshlocation. - Ovidiu Uşvat