High Performance Computing guides and policies for the University of Queensland.
Each time you run ssh, scp, sftp or rsync to Bunya, your computer normally opens a new connection and you must enter your password and your MFA code again.
SSH multiplexing lets you log in once. Your first connection stays open, and any further ssh, scp, sftp or rsync commands to Bunya use that same connection. You are not asked for your password or MFA code again while the first connection is open.
This is useful if you:
scp or rsync commandsAll sessions that share a connection are on the same Bunya login node as your first session. Use the hostname command to see which login node you are on.
[!CAUTION] While the shared connection is open, anyone who can use your local account on your computer can open a session on Bunya as you, without a password or MFA code.
Only set this up on a computer where you have your own local account that nobody else uses. Lock your screen when you step away from your computer. Close the shared connection when you have finished working (see below).
The rules in the Bunya User Guide about not sharing passwords, SSH keys or MFA apply here too. Allowing another person to use your shared connection is a violation of UQ’s policies and the Bunya conditions of access.
| Your computer | Can use multiplexing? |
|---|---|
| Mac | Yes, using Terminal |
| Linux | Yes |
| Windows with WSL | Yes, from inside WSL |
Windows cmd or PowerShell |
No. The SSH client built into Windows does not support multiplexing. Please use WSL. |
| Windows with PuTTY | Yes, using PuTTY’s own setting. See PuTTY users. |
| Windows with WinSCP | Not needed. WinSCP already lets you transfer many files after a single MFA login. |
| Windows with MobaXterm | No. MobaXterm does not support multiplexing. |
All of these steps are done on your own computer, not on Bunya.
mkdir -p ~/.ssh/sockets
chmod 700 ~/.ssh ~/.ssh/sockets
Open the file ~/.ssh/config in a text editor (create it if it does not exist) and add the following lines.
Replace username with your Bunya username. UQ users use their UQ username. QCIF users use their QSAC username.
Host bunya
HostName bunya.rcc.uq.edu.au
User username
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
ControlPersist 1h
ServerAliveInterval 60
ServerAliveCountMax 3
Then make sure only you can read the file:
chmod 600 ~/.ssh/config
[!NOTE] If your
~/.ssh/configfile already has aHost *section, put theHost bunyalines above it. SSH uses the first value it finds for each setting. Or use a unique name instead ofbunyato distinguish from a non-multiplexing connection.
| Setting | What it does |
|---|---|
Host bunya |
A short name for Bunya. You can now type ssh bunya instead of ssh username@bunya.rcc.uq.edu.au |
HostName |
The address of Bunya |
User |
Your Bunya username |
ControlMaster auto |
Use the shared connection if one is open. If none is open, start one. |
ControlPath |
Where the shared connection file is kept. %C is replaced with a unique code made from your connection details. |
ControlPersist 1h |
Keep the shared connection open for 1 hour after your last session to Bunya closes |
ServerAliveInterval 60 and ServerAliveCountMax 3 |
Check every 60 seconds that Bunya can still be reached. Close the shared connection after 3 checks with no reply (about 3 minutes). |
You can make ControlPersist shorter (for example 15m) if you prefer. A shorter time means you will be asked to log in again more often.
[!IMPORTANT] Always use the short name
bunyain your commands. If you type the full address, for examplessh username@bunya.rcc.uq.edu.au, the settings above are not used and you will be asked for your password and MFA code every time.
ssh bunya
Enter your password and MFA code as normal. See the MFA section of the Bunya User Guide if you need help with this step.
Open another terminal window on your computer and type:
ssh bunya
You will be logged in straight away, with no password or MFA prompt.
Copy a file from your computer to your Bunya scratch directory:
scp results.tar.gz bunya:/scratch/user/username/
Copy a file from Bunya to the current folder on your computer:
scp bunya:/scratch/user/username/output.log .
Copy a whole folder with rsync:
rsync -av mydata/ bunya:/scratch/user/username/mydata/
Start an sftp session:
sftp bunya
None of these commands will ask for your password or MFA code while the shared connection is open.
ssh -O check bunya
If it is open you will see something like:
Master running (pid=12345)
ssh -O exit bunya
You will see:
Exit request sent.
[!WARNING]
ssh -O exit bunyacloses every session that uses the shared connection. This includes anyscp,sftporrsynctransfer that is still running. Wait for your transfers to finish first.
If you close the terminal window you used for your first login, the shared connection stays open in the background until the ControlPersist time runs out. Your other sessions keep working.
PuTTY has its own connection sharing setting.
bunya.rcc.uq.edu.au.Log in with this saved session as normal. Any further PuTTY windows opened with the same saved session will log in without asking for your password or MFA code.
Keep the first PuTTY window open. Closing it ends the other PuTTY sessions that share its connection.
ssh bunya and not the full address.Host bunya section is above any Host * section in ~/.ssh/config.cmd and PowerShell SSH client does not support multiplexing.ssh bunya hangs, or gives an error about the control socketThis can happen after your computer has been asleep, after you change network, or after your VPN disconnects.
ssh -O exit bunya.rm -f ~/.ssh/sockets/*
ssh bunya
Bunya is taken offline for maintenance on the second Tuesday of February, May, August and November. Your shared connection will be closed. Log in again once Bunya is back. See When Bunya is down for maintenance.
ssh -S none bunya
This opens a new, independent connection. You will be asked for your password and MFA code.
Email rcc-support@uq.edu.au and include:
ssh -v bunya