linux_ssh_access
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux_ssh_access [2019/01/02 11:40] – ktm5j | linux_ssh_access [2025/09/08 12:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Linux Server Access ===== | ||
+ | |||
+ | All Linux servers run " | ||
+ | |||
+ | Users on a Windows PC can use a Terminal application like // | ||
+ | |||
+ | Users on a Mac can use an application like // | ||
+ | |||
+ | If you'd like to use a graphical windowing interface to our servers, see: [[nx_lab|Nomachine Remote Desktops]] | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== On Grounds ===== | ||
+ | You can //ssh// to CS servers. | ||
+ | |||
+ | Use your CS domain userid (identical to your UVA userid) and password to //ssh// to '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Off Grounds: Option 1: VPN access ==== | ||
+ | |||
+ | Start a VPN session to UVA using the [[https:// | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Off Grounds: Option 2: ssh to portal.cs.virginia.edu ==== | ||
+ | You can //ssh// directly into '' | ||
+ | |||
+ | For example: | ||
+ | < | ||
+ | [abc1de@outside-uva ~]$ ssh abc1de@portal.cs.virginia.edu | ||
+ | abc1de@portal.cs.virginia.edu' | ||
+ | Last login: Mon Jul 29 14:12:10 2021 | ||
+ | abc1de@portal04 ~ $ hostname | ||
+ | portal04 | ||
+ | abc1de@portal04 ~ $ ssh gpusrv01 | ||
+ | abc1de@gpusrv01' | ||
+ | abc1de@gpusrv01 ~ $ <-- you are logged into gpusrv01 | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Jumphost Option ==== | ||
+ | The //ssh// command has an option '' | ||
+ | |||
+ | Here is how we use this option to " | ||
+ | |||
+ | < | ||
+ | [abc1de@outside-uva ~]$ ssh abc1de@gpusrv01 -J abc1de@portal.cs.virginia.edu | ||
+ | abc1de@portal04.cs.virginia.edu' | ||
+ | abc1de@gpusrv01' | ||
+ | abc1de@gpusrv01 ~ $ <-- you are logged into gpusrv01 | ||
+ | </ | ||
+ | |||
+ | ==== SSH Configuration for Jumphost ==== | ||
+ | You can also have a local configuration file with the following contents. This file is on your laptop or desktop | ||
+ | |||
+ | * On **Windows** this file is: '' | ||
+ | * On **Linux/ | ||
+ | |||
+ | < | ||
+ | Host * | ||
+ | ServerAliveInterval 60 | ||
+ | | ||
+ | Host portal | ||
+ | HostName portal.cs.virginia.edu | ||
+ | User < | ||
+ | |||
+ | Host <CS server name> | ||
+ | HostName <CS server name> | ||
+ | User < | ||
+ | ProxyJump portal | ||
+ | </ | ||
+ | |||
+ | If you have an SSH keypair, you can specify it to be used for logging into a CS server. This requires that the public key contents be save in your CS home directory file '' | ||
+ | < | ||
+ | Host portal | ||
+ | HostName portal.cs.virginia.edu | ||
+ | User < | ||
+ | IdentityFile / | ||
+ | </ | ||
+ | |||
+ | Then you can do the following | ||
+ | < | ||
+ | ~$ ssh portal | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== SSH Key Generation for Logging into Portal ===== | ||
+ | SSH keys can be generated and used for SSH authentication to CS login servers such as **portal**. | ||
+ | |||
+ | To do this, start by generating a key. This can be done on your local computer by opening a terminal. | ||
+ | |||
+ | === 0.1: SSH for Linux & MacOS === | ||
+ | Application for running this command are **Terminal** | ||
+ | |||
+ | === 0.2: SSH for Windows === | ||
+ | Applications for running this commands are **Command Prompt** or **PowerShell** | ||
+ | |||
+ | After opening the appropriate application, | ||
+ | < | ||
+ | ~$ ssh-keygen -t ed25519 -C "< | ||
+ | |||
+ | OR | ||
+ | |||
+ | ~$ ssh-keygen -t rsa -b 4096 -C "< | ||
+ | </ | ||
+ | |||
+ | After doing so, you may be prompted for where to save the file to choose a non-default location, select **Enter** to use the path shown | ||
+ | < | ||
+ | Enter file in which to save the key (/ | ||
+ | </ | ||
+ | |||
+ | Then, you can choose to further protect your key with a passphrase, which is recommended to do | ||
+ | < | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | </ | ||
+ | |||
+ | Then, you will see the following output | ||
+ | < | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | The key fingerprint is: | ||
+ | SHA256: | ||
+ | The key's randomart image is: | ||
+ | +--[ED25519 256]--+ | ||
+ | | . | | ||
+ | | + . | | ||
+ | | . B . | | ||
+ | | o * + | | ||
+ | | X * S | | ||
+ | | + O o . . | | ||
+ | | . E . o | | ||
+ | | . . o | | ||
+ | | . . | | ||
+ | +----[SHA256]-----+ | ||
+ | </ | ||
+ | |||
+ | Referencing the above, two files are generated | ||
+ | - '' | ||
+ | - '' | ||
+ | |||
+ | After generating the key, you will need to copy the contents of the **Public Key to your home directory on CS servers**. In this example, we'll copy **/ | ||
+ | |||
+ | On **MacOS** and **Linux** you can use the following command, which requires entering your SSH password, replace '' | ||
+ | < | ||
+ | ~$ ssh-copy-id < | ||
+ | </ | ||
+ | |||
+ | On **Windows**, | ||
+ | < | ||
+ | C: | ||
+ | </ | ||
+ | |||
+ | Then, after copying the the public key contents, you can use the key to SSH into portal, entering the passphrase for the key (if one was used) | ||
+ | < | ||
+ | ~$ ssh < | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Host Names depend upon your network connection ===== | ||
+ | If you are on the Computer Science network just use the hostname of a server (ex. // | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Available Servers ==== | ||
+ | For a listing of generally available servers in CS, see [[compute_resources|Computing Resources]] | ||