How can I change the Open OnDemand SSH port

All my machines use SSH port 24739, but when I try to login via SSH, I get “ssh: CONNECT TO HOST * PORT 22: connection refused.” I found a similar question on Open OnDemand Discourse, but it has no answer. I tried setting OOD_SSH_PORT=“24739” in /etc/ood/config/apps/dashboard/env


, but it didn’t work.

That configuration is for something different unfortunately. I would say to provide an ssh wrapper that can set the port.

https://osc.github.io/ood-documentation/latest/customizations.html?#shell-app-ssh-command-wrapper

[root@oodrk9dev tmp]# cat /usr/bin/ssh_wrapper.sh
#!/bin/bash

args="-o SendEnv=MY_ENV_VAR -p 24739"
echo "SSH Arguments: $args" >> /tmp/ssh_wrapper.log
exec /usr/bin/ssh "$args" "$@"
[root@oodrk9dev tmp]# cat /etc/ood/config/apps/shell/env 
OOD_SSHHOST_ALLOWLIST="sl-c[0-9][0-9][0-9][0-9]"
OOD_SSH_WRAPPER="/usr/bin/ssh_wrapper.sh"

These settings still did not work, and it continued to indicate that the connection was on port 22. Ultimately, it only took effect when I set Host * Port 24739 in /etc/ssh/ssh_config.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.