Skip to content

Copying Files to and from a Bastion VM

Pulling a file from a Bastion server

To pull one or more files from a Bastion server to your workstation or server, you can use the following command:

scp -P 2222 -o User=<local user>:<remote server> qcbas-qcint.quintessence.de:'<remote file path>' <local file path>
When pulling a file to your local workstation, the local user is your user (you need to have a private key available and a public key in Bastion)

Example: to copy a file from the mga3dev server to the qcgaia-qcint server, you can use the following command on the qcgaia-qcint server:

scp -P 2222 -o User=qcgaia-qcint:mga3dev qcbas-qcint.quintessence.de:'/home/qcuser/path/to/remote/file' /home/qcuser/pat/to/local/file
Example: to copy a file from the qcgaia-qcint server to your workstation, you can use the following command on your workstation:
scp -P 2222 -o User=wgielen:qcgaia-qcint qcbas-qcint.quintessence.de:'/home/qcuser/path/to/remote/file' /home/qcuser/pat/to/local/file
Please take note of the '' in the remote path

Pulling a file from a non-Bastion server

To pull one or more files from a non-Bastion server (such as an environment in the HAJ office), you can use the following command:

scp <remote user>@<remote ip>:<remote file path> <local file path>
This is a plain vanilla scp command. Please note that qcuser needs to have a private key on the local server (or workstation) and a public key on the remote (non-Bastion) server and that you need to use the ip and not the DNS name if the DNS name is not available.

Example: to copy a file from the lha3dev server to the qcgaia-qcint server, you can use the following command on the qcgaia-qcint server:

scp qcuser@10.10.123.50:/home/qcuser/path/to/remote/file /home/qcuser/pat/to/local/file

If your public key is not available on the remote server, you can copy it using following command (assuming we are using qcuser):

ssh-copy-id -i ~/.ssh/id_rsa.pub qcuser@<remote ip>

Pushing a file to a Bastion server

To push a file to a Bastion server, you can use the following command:

scp -P 2222 -o User=<local user>:<remote server> <local file path> qcbas-qcint.quintessence.de:<remote file path> 
Example: to copy a file from your workstation to the qcgaia-qcint, you can use the following command on your workstation:
scp -P 2222 -o User=wgielen:qcgaia-qcint /home/qcuser/pat/to/local/file qcbas-qcint.quintessence.de:/home/qcuser/path/to/remote/file

Pushing a file to a non-Bastion server

To push one or more files to a non-Bastion server (such as an environment in the HAJ office), you can use the following command:

scp <local file path> <remote user>@<remote server>:<remote file path>
This is a plain vanilla scp command. Please note that qcuser needs to have a private key on the local server (or workstation) and a public key on the remote (non-Bastion) server and that you need to use the ip and not the DNS name if the DNS name is not available.

Example: to copy a file from your workstation to the mglhdev server, you can use the following command on the your workstation:

scp /home/qcuser/pat/to/local/file qcuser@10.10.123.50:/home/qcuser/path/to/remote/file

Changelog

Date Author Message
2026-02-25 aresnikowa Merge remote-tracking branch 'origin/master'