Hi all,
I am trying to use Jenkins Remote CLI to configure my Jenkins server remotely. I am running a jenkinsci/blueocean docker container.
To enabled SSHD on my jenkins server:
Trying ssh from bash:
ssh -l baymac -p 46653 localhost who-am-i
Error message:
ssh: connect to host localhost port 46653: Connection refused
Trying to use Jenkins CLI client to ssh into Jenkins server with the following command:
I receive an error message:
Enter passphrase for /home/parichay/.ssh/id_rsa:
Mar 24, 2019 6:38:56 AM org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver reloadHostConfigEntries
INFO: resolveEffectiveResolver(baymac@localhost:46653) loaded 1 entries from /home/parichay/.ssh/config
org.apache.sshd.common.RuntimeSshException: Failed to get the session.
at org.apache.sshd.client.future.DefaultConnectFuture.getSession(DefaultConnectFuture.java:59)
at hudson.cli.SSHCLI.sshConnection(SSHCLI.java:104)
at hudson.cli.CLI._main(CLI.java:608)
at hudson.cli.CLI.main(CLI.java:427)
Caused by: java.net.ConnectException: Connection refused
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:293)
at java.lang.Thread.run(Thread.java:748)
I enter the right passphrase, since I tried to ssh into another device it is working.
Extra information:
I run the docker with the following command:
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
HTTP auth works:
java -jar jenkins-cli.jar -s http://localhost:8080/ -auth baymac:<api_token> who-am-i
Message:
Authenticated as: baymac
Authorities:
authenticated
I am unable to debug this, a pointer to this error would be really helpful.
Regards,
Parichay (baymac)