Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSHAgent Not working in Jenkins #127

Open
mohammad-sajid opened this issue Jul 7, 2022 · 0 comments
Open

SSHAgent Not working in Jenkins #127

mohammad-sajid opened this issue Jul 7, 2022 · 0 comments

Comments

@mohammad-sajid
Copy link

Hello,

I tried as per your instructions in my local setup. while deploying container in-app server by configuring SSH login with private key but it's showing permission denied. could you pls help me here?

Started by user [admin](http://192.168.29.60:8080/user/admin)
[Pipeline] Start of Pipeline
[Pipeline] node
Running on [Jenkins](http://192.168.29.60:8080/computer/(built-in)/) in /var/lib/jenkins/workspace/DockerRun
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Run Container on Dev Server)
[Pipeline] sshagent
[ssh-agent] Using credentials root (dev-server2)
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent]   Exec ssh-agent (binary ssh-agent on a remote machine)
$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-lBoBkfa2es1x/agent.20843
SSH_AGENT_PID=20847
Running ssh-add (command line suppressed)
Identity added: /var/lib/jenkins/workspace/DockerRun@tmp/private_key_15706497917088372409.key (/var/lib/jenkins/workspace/DockerRun@tmp/private_key_15706497917088372409.key)
[ssh-agent] Started.
[Pipeline] {
[Pipeline] sh
+ ssh -o StrictHostKeyChecking=no [email protected] docker run -p 8180:8080 -d --name my-app2 mdsajid020/my-app:2.0.0
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
[Pipeline] }
$ ssh-agent -k
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid 20847 killed;
[ssh-agent] Stopped.
[Pipeline] // sshagent
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 255
Finished: FAILURE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant