lambci: Errors with ssh/git-ssh: PRIV_END: seteuid: Operation not permitted
First raised in https://github.com/lambci/lambci/issues/11#issuecomment-231724286
Seems that the Lambda environment has some sort of restriction (no seteuid
perhaps?) that prevents the ssh client from running:
$ ssh -vT git@github.com
PRIV_END: seteuid: Operation not permitted
This also means that cloning repositories over git-ssh will fail, eg git clone git@github.com/mhart/kinesalite.git
– a number of projects do this for sub-dependencies.
Not sure what we can do about this? Besides compiling a custom ssh client.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 34 (9 by maintainers)
Came here on a google. Had this same issue, but I’m using containers to deploy my lambdas. So, I just need to have the patched version of
ssh
in my container image. Bare minimum example:So here’s a full working example – this works directly from the Lambda console (with a Node.js 4.3 function):
I’ll leave
lambda-git-test.tgz
up on S3 for the foreseeable future – but if I don’t discover any issues with it, then I’ll replace the existing git bundle in LambCI – so LambCI users shouldn’t have any further issues with ssh repos.Alright, some good news- running ssh (and subsequently git) in a Lambda environment is possibly albeit a little hacky.
A quick summary:
seteuid()
(surprisingly easy. I can provide more info if requested)ssh
binary and supporting librariesgit
binary and needed supporting binaries (typically found in/usr/lib/git-core
[at least on Arch]) (You may need different binaries. These are just the git functions I used.)PATH
variablessh
,git
, and all git binariesLD_LIBRARY_PATH
variable.so
files for ssh@jdchmiel one of my requirements was that I had to use ssh keys. Thanks for the tip though.
@mhart I wasn’t aware of these layers. Just yesterday I was wondering if anything like this existed out there. Thanks for sharing!
@sjackman Thank you! I was finally able to build it from source
@mhart Thanks for the detailed follow up. It works for me too! Here’s my Lambda function that uses
git
,ssh
andruby
. https://github.com/sjackman/linuxbrew-lambda Here’s the tarballs of binaries that I used: