Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using EC2 and am new to the world of Linux, and I've looked for an answer to this but I think I'm just not sure how to ask the question correctly.

I have installed Jenkins and git using yum, under the account ec2-user, and they install fine. Yum created an account called jenkins which runs the Jenkins process (checked this using ps -aux and the user is jenkins).

I have a remote git repository that uses public/private keys. When I ssh-keygen, and then connect to my remote git repository through ec2-user, everything is fine. I'm just not certain how or where to create a key for the jenkins user.

This is where my trouble starts. When I su jenkins and then cd ~, I wind up in ~ec2-user. When I run ssh-keygen as jenkins, it wants to put the key into /home/ec2-user/.ssh/id_rsa - and that doesn't seem right.

How can I create a key pair for jenkins, or should I just have it added to the ~ec2-user/.ssh/id_rsa?

share|improve this question
add comment

1 Answer

Don't use su jenkins, use su - jenkins. Then you should inherit the environment of the jenkins user, and key creation etc. should proceed painlessly.

share|improve this answer
    
The prompt still shows me as ec2-user. Is that correct? –  Triple Gilaman Feb 25 '13 at 18:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.