jjethwa / rundeck

GNU General Public License v3.0
123 stars 137 forks source link

SSH Key Login not possible #157

Closed RolandSM closed 5 years ago

RolandSM commented 5 years ago

Hello, I test to put Rundeck into a Docker and I got it to run, but my SSH connections cannot authenticate? I have for example one server with own ssh port 111.222.333.444:12345 This works on a normal Rundeck installation. Same in the Docker one the report is: "Failed: AuthenticationFailure: Authentication failure connecting to node: "111.222.333.444". Make sure your resource definitions and credentials are up to date." Then I tried to create a new .ssh/id_rsa.pub inside the docker machine. -> No success Also I tried it on the host machine where docker runs. -> No success Both are able to login from terminal with this key as I put it via ssh-copy-id to the server and the authorized_keys shows them.

The auth.log on the server shows: server sshd[6147]: error: Received disconnect from xxx.xxx.xxx.xxx port 44732:3: com.jcraft.jsch.JSchException: Auth cancel [preauth] The port is another as SSH listen!

Do I have to put more ports into docker run like the ones from ssh servers???

jjethwa commented 5 years ago

Hi @Sh4d0wF1gh7

No more ports need to be added to the docker run command. Just to confirm, the node definition has the nonstandard SSH port defined? Also, in the project node configuration, do you have the correct path to the SSH private key you need to use? You'll probably want to use a volume or key storage for the key as well.

RolandSM commented 5 years ago

Hello, wow great fast answer. Yes I defined the port as hostname="111.222.333.444:12345" like in my other Rundeck installation outside docker. In the project configuration is: /var/lib/rundeck/.ssh/id_rsa

and also there I copied the id_rsa but without succcess.

From terminal all works, from rundeck not. Possible that rundeck starts with a rundeck user? not root???

RolandSM commented 5 years ago

On the default node executor i also cannot modify anything? won´t save???

jjethwa commented 5 years ago

Yes, rundeck starts as the rundeck user for security. What version of the container are you using?

RolandSM commented 5 years ago

:latest Rundeck 3.0.13-20190123

in the framework.properties is also the path from key and user but also on my old installation its the same like on the new but as written, root ssh works on old one.

RolandSM commented 5 years ago

I got it... First copy from /root/.ssh/id_rsa to /var/lib/rundeck/.ssh Second the files in last folder have to chown rundeck:rundeck.

Not it works. Thanks

jjethwa commented 5 years ago

That's great news. Sorry, I had missed that the key you wanted to use was under /root. Don't forget that you should use a volume for the new key or use the key storage solution in Rundeck itself.