SSH Multiplexing
Setting up ssh multiplexing can make your life significantly easier. This can allow you to ssh with your credentials once, and if the connection is still open, have subsequent ssh sessions run without having to authenticate again. In other words, you don't have to enter your password and verification code as often. For more information, this is a great resource.
Set up
Windows
In order to have ssh multiplexing enabled on windows, WSL (Windows Subsystem of Linux) needs to be installed. Open PowerShell in administrator mode by searching for it in the Windows search bar and selecting "Run as administrator." In PowerShell, run
wsl --install
to install Ubuntu with default setting. See this link for more options and information.
After the installation is complete, run
ubuntu
It should let you set up your account, but there are some common errors. Note: the username can only contain lowercase letters, underscores, and dashes.
If you get error 0x80370102, use the Windows search bar to search for "Windows Features." Open it and scroll down to "Hyper-V." If it is unchecked, check it, hit "OK," and let it restart your computer. Pull up PowerShell and run "ubuntu" to resume set up.
If you get error 0x80370114, use the Windows search bar to search for "Windows Features." Open it and scroll down to "Virtual Machine Platform" and "Windows Subsystem for Linux." If either are unchecked, check both of them, hit "OK," and let it restart your computer. Pull up PowerShell and run "ubuntu" to resume set up.
From this point, continue with the directions for Linux, MacOS, and WSL.
Note: Opening PowerShell and running ubuntu is how you use WSL. You will always need to be on WSL for ssh multiplexing to work.
Linux, MacOS, and WSL
To set up multiplexing, create the ~/.ssh/config file ("~" means you home directory) on your local system. The easiest way to do this is by using your favorite text editor (ex: vim or nano) to edit the file. One way to do this is as follows:
vim ~/.ssh/config
Place the following in config:
Host *
User <REPLACE WITH YOUR USERNAME>
ControlMaster auto
XAuthLocation /opt/X11/bin/xauth
Host orc
HostName ssh.rc.byu.edu
ControlPath ~/.ssh/master-%r@%h:%p.socket
ControlPersist yes
ForwardX11 yes
ServerAliveInterval 300
Don't forget to replace the angle brackets and everything in them with your supercomputer username.
Running
In your terminal, run
ssh orc
It will prompt you for your password and verification code. After entering your credentials, you will have logged onto the supercomputer. If you're using WSL and see perl warnings, read the "Perl Warnings" section. In a second terminal, run
ssh orc
again. This time you shouldn't have to enter your password and verification code.
You've successfully set up ssh multiplexing!
Perl Warnings
If you come across perl warnings in our login message, you need to edit your .bashrc file found on the supercomputer. You might have to create this if you haven't previously. Towards the top, you should add the following code:
### Locale ###
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
This warning error will still pop up on your initial log in, but any subsequent programs that need these environment variable will now be able access them.
Cancel Existing Connections
On rare occasions, you might have connection problems. Running
ssh -O exit orc
might help.
Last changed on Mon Sep 16 13:01:30 2024