I am trying to clone to a gerrit server using another user username2 however it fails with Permission denied (publickey). I tried to generate an ssh key following the advice of Server Fault question "how do you create an ssh key for another user?"
The following steps didn't work. What am I missing?
ssh-keygen -f ~/.ssh/username2cp ~/.ssh/username2.pub ~/.ssh/authorized_keys- Added the username2.pub to tech-gerrit.sd.company.com
- ~/.ssh/config
Host tech-gerrit.sd.company.com HostName tech-gerrit.sd.company.com Port 29418 User username2 IdentityFile /Users/username1/.ssh/username2
- Tried to clone using below command
git clone ssh://username2@tech-gerrit.sd.company.com:29418
- Logged in as username2 into gerrit and added the username2.pub to