-
Notifications
You must be signed in to change notification settings - Fork 3
Starting with Compute Canada
Setting up will depend on whether you work on a Windows or Mac. Read through the page here (https://www.learnenough.com/command-line-tutorial/basics) and follow its instructions on setting up. In particular, if working on Windows, I strongly recommend you setup Windows Subsystem Linux.
The default terminal experience on windows isn't great, so we'll need to do a few extra steps to get ready.
You should have no trouble you have an up-to-date Windows 10 or 11. You may need to turn on desktop virtualization for it to work though. To do this, restart your computer. When it just starts booting, it should say something like Press Delete to enter BIO or something like that. Do that, and look for the virtualization option and make sure it's enabled. For more details, you're best off searching info for you specific computer module.
Once virtualization is enabled, simply follow the windows instructions for installing WSL (https://docs.microsoft.com/en-us/windows/wsl/install).
The steps above should automatically install Ubuntu to your computer. You can search for it and run it from the start menu. If it doesn't you may have to go to the windows store to manually install it. (Just search for Ubuntu). When you start Ubuntu for the first time, a terminal will open, and you'll be asked for a password.
Note that, although the terminal is the primary way of accessing WSL, you can access it from Windows Explorer. This is easy in Windows 11: there should be a Linux section at the bottom of the left hand file chooser. In windows 10, you'll have to enter the secret path into the navbar (see here https://www.howtogeek.com/426749/how-to-access-your-linux-wsl-files-in-windows-10/). Once it's open there, you can open any files using native windows programs.
Go to the windows store and install Windows Terminal. This is a modern terminal with features (such as tabs, split screens, etc) that you don't get on any default installed terminal. Open it, press the drop-down button next to the new tab button, and go to settings. Select your Default Profile from the drop-down to be Ubuntu or similar (whatever version of WSL you just installed).
The above "learnenough.com" tutorial is great, but you'll hit a paywall really fast. I'd recommend the content here: https://linuxcommand.org/lc3_learning_the_shell.php. Everything from "2. Navigation" onward will be useful.
An SSH key is basically a very long password that's stored on a file on your computer. The advantage compared to a regular password is that, first, you don't have to remember it, and two, it's linked to a specific computer. Because it's so much stronger than any regular password you might come up with, it makes it impossible for anyone to guess it by brute force. Thus, many server, including I believe Compute Canada, no longer allow traditional passwords.
An SSH has two parts, each stored in different files. The "Private Key" will be stored in the~/.ssh/<key_name> file (note that tilde (~) just means home directory), and the "Public key" will be stored in the ~/.ssh/<key_name>.pub file. The private key will stay on your local machine and should never be handled directly. The public key will need to be uploaded to the server. It's what the server uses to validate your private key when you try to login. The actual steps to accomplish this are documented on the compute canada website (https://docs.computecanada.ca/wiki/Using_SSH_keys_in_Linux).
Compute Canada has a nice series of intro videos on youtube. Videos 3, and 5-8 are the most immediately relevant, the others provide more background info.