Editing
SSH
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= SSH Login = To log in to a cluster, use the following command, replacing <code><username></code> with your username and <code><mycluster></code> with the fully qualified domain name (FQDN) of your cluster: ssh <username>@<mycluster> <span id="passwordless-login"></span> == Passwordless Login == If you want to bypass password authentication, you can use SSH key authentication. SSH keys allow you to connect to a server or multiple servers without entering your password each time. To generate an SSH key pair, follow these steps: <ol> <li>On your local machine, generate an SSH key:</li> </ol> ssh-keygen -t ed25519 -C "[$(whoami)@$(uname -n)-$(date -I)]" <ol start="2"> <li>Automatically add your public key to the server by running the following command (use your ANDREW password):</li> </ol> ssh-copy-id -i ${HOME}/.ssh/id_ed25519.pub <username>@<mycluster>. # for windows, first navigate to your .ssh folder, then run: type .\id_ed25519.pub | ssh <username>@<mycluster> "cat >> .ssh/authorized_keys" <ol start="3"> <li>You can also configure your <code>~/.ssh/config</code> file to avoid typing the full cluster address every time. Add the following lines to the file:</li> </ol> Host <mycluster> HostName <mycluster's hostname> User <username> IdentityFile ${HOME}/.ssh/id_ed25519 <ol start="4"> <li>Then, you can log in with the simple command <code>ssh ''mycluster''</code>.</li> </ol> <span id="shell-configuration"></span> == Connecting to a Compute Node == You can also ssh directly to a compute node where you have a job already running by doing: ssh -J babel babel-X-XX More on [[Port Forwarding]] == Copying Data to Compute Nodes == To copy data to compute nodes when the data directories are not directly accessible from the login nodes, you can utilize the login node as a JumpHost, allowing direct connections to the compute nodes. Follow these steps to configure SSH and establish the connection: <ol> <li>Launch an interactive job on a compute node.</li> <li>Determine the IP address of the compute node by executing the <code>ip a</code> command on the compute node itself.</li> <li>Update your SSH configuration file located at <code>~/.ssh/config</code> with the following entries:</li> </ol> Host <mycluster-short-name> HostName <mycluster-fqdn> User <username> IdentityFile <identityfile> Host <mycluster>-compute-node HostName <node ip addr> User <username> ProxyJump <mycluster> Replace the relevant items in <code> < ></code> with your actual username, cluster name and the path to your SSH private key file. For example, to connect to a node in the Babel cluster: Host babel HostName babel.lti.cs.cmu.edu User <username> IdentityFile /path/to/identityfile Host babel-compute-node HostName <node ip addr> User <username> ProxyJump babel The updated configuration allows you to establish a connection to the compute node through the login node, acting as a JumpHost. Refer to your cluster's dedicated page in the [[:Category:Clusters| Cluster's]] section for more detailed information. <span id="why-is-there-a-ssh-key-pair-in-home-dir-upon-first-login"></span> == Why is there an SSH key pair in the home directory upon first login? == When a user runs a job on two nodes, their script might need to SSH from node-1 to node-2. If the SSH connection fails or hangs, it is often because the fingerprint of the target node is not in the <code>~/.ssh/known_hosts</code> file. To prevent this issue, we automatically create SSH keys and add the necessary fingerprints to <code>~/.ssh/authorized_keys</code> when the user's home directory is created. This process also eliminates password prompts when connecting to a node where you have a job running. For more information on generating these keys, see: [[SSH#Passwordless_Login|Connecting to the Cluster - Passwordless Login]]
Summary:
Please note that all contributions to CMU -- Language Technologies Institute -- HPC Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Tools
What links here
Related changes
Page information