![]() ![]() On my Mac it is: /Users/my-user-name/. and add it to the remote's authorized_keys file in: ~/.ssh/authorized_keysĪnother, in my case better solution was to add a custom host in my local ssh config file. You can observe what the SSH program does when executing the command by adding -v to the command: ssh -v you just grab on your local machine any public key the SSH program tries to use, for example (on a Mac): cat ~/.ssh/id_rsa.pub One solution was to add on the remote server an SSH key which the SSH program tried to use. For any reason (didn't bother myself to find out for which reason actually, as I found a quick fix) when executing the ssh command the program didn't look for the right identity file. In my case it was nothing related to the permissions. command="git-shell" nopty no-agent-forwarding no-port-forwarding no-X11-forwarding).Īs this questions appears among the first search results when googling for this error, I will also add my solution: Check the configuration to see whether restrictions on the use of the key should be added at the end of the file (e.g. Once you've found the file, add the public key to it: an authorized_keys files is just a list of line, each normally containing a public key copied straight from a. Check the SSH server configuration ( /etc/sshd_config or /etc/ssh/sshd_config to see where the authorized_keys files are located ( AuthorizedKeysFile setting). If you're the administrator, you need to dig in to find out how the git accounts are set up. There is usually an out-of-band mechanism to set up credentials, for example a web interface. This is done by having a ~/.ssh/authorized_keys that isn't writable by the user. In particular, git access should not be enough to change the credentials and restrictions on the account. ![]() If an account is dedicated to git usage, it makes sense for the administrator to make it a restricted account, only allowed to run git commands. ![]() lastly changed the rw permission to 600 via chmod 600 ~/.ssh/authorized keysand successfully copied the key over changed ownership of the authorized_keys file via chown git /home/git/.ssh/authorized keysto git ssh/authorized_keys: Permission deniedĮdit: I solved the problem the following way: Prompted now it is to install the new password: usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed - if you are usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), toįilter out any that are already installed ssh-agent -s > /mysshagent source /mysshagent rm /mysshagent Now start loading keys into your SSH Agent ssh-add /. $ ssh-copy-id -i INFO: Source of key(s) to be installed: The sequence would be: Generate a decent 4k key ssh-keygen -t rsa -b 4096 -f /.ssh/idrsa4k Start your ssh-agent up and suck in information like SSHAGENTPID, etc. ssh-copy-id is a script that uses ssh to log into a remote machine (presumably using a login password, so password authentication should be enabled, unless youve done some clever use of multiple identities) It also changes the permissions of the remote users home, /.ssh, and /. I stumbled over the possibility to let ssh do the copying work with ssh-copy-id, however it does not seem to work out for me. I'm trying to set up a git repo for a project and therefore I want to make use of ssh keys in order to not re-enter my password every time. ![]()
0 Comments
Leave a Reply. |