salt icon indicating copy to clipboard operation
salt copied to clipboard

git.latest identity / ssh key issues

Open techdragon opened this issue 13 years ago • 3 comments

git.latest is unable to correctly use a users private key when it is setup correctly as per the SSH expectation of being unable to be read by other users.

deployment-private-keys:
    file.managed:
        - name: /home/example/.ssh/id_rsa
        - source: salt://files/deployment_private_key
        - user: example
        - group: example
        - mode: 600

local-mirror-of-production-code:
    git.latest:
        - name: [email protected]:example/example.git
        - rev: master
        - target: /srv/code/website/
        - user: example
        - identity: /home/example/.ssh/id_rsa
        - require:
            - pkg: git
            - file: deployment-private-keys

This should work, if the git.latest function correctly operates as the user 'example' then it should have rights to view and use the private key that was set with mode 600. this is failing.

State: - git
    Name:      [email protected]:example/example.git
    Function:  latest
        Result:    False
        Comment:   Warning: Identity file /home/example/.ssh/id_rsa not accessible: Permission denied.

techdragon avatar Dec 01 '13 10:12 techdragon

Found an issue with the system i was running this on. Closing the issue.

techdragon avatar Dec 01 '13 10:12 techdragon

Thanks for stating what the issue you found was. Classic "nvm I figured it out" comment.

johnavance avatar Jan 11 '14 22:01 johnavance

I had the same issue today. I logged with shsh and found that the user could not read the identity file because /home//.ssh directory had mode 600, hence missing execution right. This solved the issue for me: chmod 700 /home/<user>/.ssh

phildav avatar Feb 17 '15 10:02 phildav