how to configure jenkins to use jenkins CLI by ssh

24 views
Skip to first unread message

oneslide icywater

unread,
Feb 20, 2020, 9:32:51 AM2/20/20
to Jenkins Users
with https://jenkins.io/doc/book/managing/cli/ ,I successfully configure jenkins to use its CLI by app token and user-password,but ssh failed.

I run my jenkins in docker in local testing vm。

docker container run --name jenkins-blueocean --rm --detach \
  --network jenkins --env DOCKER_HOST=tcp://docker:2376 \
  --env DOCKER_CERT_PATH=/certs/client --env DOCKER_TLS_VERIFY=1 \
  --volume jenkins-data:/var/jenkins_home \
  --volume jenkins-docker-certs:/certs/client:ro \
  --publish 8080:8080 --publish 50000:50000 jenkinsci/blueocean

using ssh-keygen to generate RSA key pair,and put the id_rsa.pub content to  Configure -> SSH Public Keys

enable SSHD Port in 8081

when I test my ssh configure,it fails:

# ssh -l oneslide -p 8081 localhost help
ssh: connect to host localhost port 8081: Connection refused

# docker exec into the container
bash-4.4$ ps -ef
PID   USER     TIME  COMMAND
    1 jenkins   0:07 /sbin/tini -- /usr/local/bin/jenkins.sh
    5 jenkins   7:16 java -Duser.home=/var/jenkins_home -Djenkins.model.Jenkins.slaveAgentPort=50000 -jar /usr/share/jenkins/jenkins.war
 7011 jenkins   0:00 bash
 7381 jenkins   0:00 ps -ef

sshd isn't running


How Can I solve it ?  

Dirk Heinrichs

unread,
Feb 20, 2020, 9:42:47 AM2/20/20
to jenkins...@googlegroups.com
Am Donnerstag, den 20.02.2020, 06:06 -0800 schrieb oneslide icywater:

sshd isn't running

How Can I solve it ?

I'm confused. Do you want to access Jenkins itself via SSH (Jenkins' internal SSH server) or the Docker container in which Jenkins runs?

Bye...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
Reply all
Reply to author
Forward
0 new messages