ssh-run alternative pipe?
Asked by Ivo:

Hi guys,   

Is there any ssh-run alternatives for Linux? We use self-hosted runners for linux.arm64 platform and ssh-run is not option for us because the pipe is not compatible with arm64 platform. scp-deploy is not an option because we have to run several commands on the remote server when we connect. Direct SSH connection seems very difficult to configure.  

Regards,


Answers:
author: Theodora Boudale
body: Hi [@Ivo](/t5/user/viewprofilepage/user-id/5517588),

I just wanted to let you know that the development team added support for linux/arm64 to the ssh-run pipe.

You should be able to use the pipe now on ARM architecture:

* <https://bitbucket.org/atlassian/ssh-run/src/master/>

If you would like to try it, please ensure that you use the latest version of the pipe.

The variable SSH_KEY in the pipe is also required (instead of keys generated in Bitbucket).

Please feel free to let me know if you have any feedback.

Kind regards,  
Theodora


author: Theodora Boudale
body: Hi [@Ivo](/t5/user/viewprofilepage/user-id/5517588) ,

I'm afraid that there is no other ssh-run pipe developed by Atlassian for ARM. I have forwarded your request to our pipes team and they will look into developing this and other pipes to work for ARM, but I don't have an ETA to share at the moment.

Kind regards,  
Theodora

comments: author: Ivo
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,  

Thank you very much! I hope they will develop pipes for ARM too.  

In the meantime I will try the SSH method which is a little bit confusing.   

Regards,   
Ivo


author: Ivo
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,

For now I'm going to use the ssh method with the following script step from the pipeline:

```
script:
- apt update && apt install -y ssh openssh-client bash
- ssh-keyscan -H $SERVER >> ~/.ssh/known_hosts
- ssh $USER@$SERVER 'ls -lah /home/path/to/project'
```

The connection seems to work fine and I see the files in the specified project folder. What is wrong is that the user and group for files and folders are incorrect and mixed with my repository variable $USER. Example:  

```
drwxrwxr-x 2 $USER $USER 4.0K Jun 25 12:23 .

drwxrwxr-x 43 $USER $USER 4.0K Jun 12 09:28 ..

-rw-rw-r-- 1 $USER $USER 2.3K Jun 25 12:23 file.php
```

<br />

I assume it's something with the permissions but I'm not able to sort it out.   

Any help?

Regards,


author: Theodora Boudale
body: Hi [@Ivo](/t5/user/viewprofilepage/user-id/5517588),

Is this the output that you see in the Pipelines build log?

This is expected behavior if your repository variable $USER is a secured variable. If some text in the Pipelines build log matches the value of a secured variable, then Pipelines masks this value and replaces it with the variable name.

For example, if the value of the repository variable $USER is **myuser** , and $USER is a secured variable, then all occurences of the text **myuser** in the build logs will be replaced with $USER.

Can you please confirm if $USER is a secured variable and if its value is the same as the user and group who owns these files on your server?

Kind regards,  
Theodora


author: Ivo
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,  

Sorry, I totally forgot about the secured variables option in the repository variables. Everything seems to work fine now. Thank you!   

Regards,  
Ivo  


author: Theodora Boudale
body: That's good to hear, Ivo, thank you for the update. Please feel free to reach out if you need anything else!

Kind regards,  
Theodora


author: Gajesh Bhat
body: Can you Run the SSH-run Pipe (<https://bitbucket.org/atlassian/ssh-run/src/master/>) on an amd64 Self hosted runner (Works on Docker Runner) and ssh into the Linux ARM Platform you have and run your scripts on there ? You can also setup ARM64 Docker Runner on your ARM64 Platform to run your Builds. <https://bitbucket.org/blog/announcing-support-for-linux-arm-runners-in-bitbucket-pipelines>


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

pipes

ssh