Replies: 3 comments
-
@FelixSab You can specify a proxy with mrsk(https://github.com/mrsked/mrsk#using-a-proxy-ssh-host) but this seems like a question for gitlab CI though. I know with github actions you have to add in a few things to get SSH connections to work properly, I'd imagine it's the same with gitlab CI. Have you tried the docker executor steps on this gitlab CI guide? https://docs.gitlab.com/ee/ci/ssh_keys/ |
Beta Was this translation helpful? Give feedback.
-
@nickhammond Yes, using ssh agent like described by the gitlab docs would be one way to solve this issue. I didn't try the proxy, but it seems counterintuitive to me to use this option only for the configuration of my ssh connection. I updated my #!/bin/bash
SSH_PATH=$(realpath ~)/.ssh
OLD_SSH_KEY_PATH=$(realpath $SECURE_FILES_DOWNLOAD_PATH)/ssh_key
NEW_SSH_KEY_PATH=$SSH_PATH/id_ed25519
# Check if the old SSH key file exists
if [ ! -f "$OLD_SSH_KEY_PATH" ]; then
echo "The file $OLD_SSH_KEY_PATH does not exist. Exiting script."
exit 0
fi
mkdir $SSH_PATH
echo $PROD_SERVER_A_PUBKEY > $SSH_PATH/known_hosts
echo $STAGING_SERVER_A_PUBKEY > $SSH_PATH/known_hosts
mv $OLD_SSH_KEY_PATH $NEW_SSH_KEY_PATH
chmod 600 $NEW_SSH_KEY_PATH If I'd change the ssh port of my servers, I'd have to use the proxy though, no? |
Beta Was this translation helpful? Give feedback.
-
@FelixSab Yah, it looks like it. |
Beta Was this translation helpful? Give feedback.
-
I am currently setting up a deployment using gitlab-ci and encountered some issues with my SSH configuration. Is there any way to have it configured besides the user name? I tried using a config, but to no avail:
The Dockerfile I am using:
My gitlab-ci.yml:
My output:
As you can see, the config is working properly when using ssh by itself, but not when using mrsk. Is there a way to provide ssh options or a config?
Help would be greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions