Advanced SSH Configuration¶
macOS and Linux¶
Here are some tips on maintaining connections and adding tab complete to your SSH commands on Linux and macOS:
-
Use
ssh_configfile to create aliases for your connections:Host alias_name HostName ogun-login.senaicimatec.com.br User your_username IdentityFile /path/to/your/private_keyReplace
alias_name,clustername,your_username, and/path/to/your/private_keywith your desired alias, the name of the cluster you want to connect to, your username, and the path to your private key file, respectively. -
Save the configuration in
~/.ssh/configfile. -
Now you can connect using the alias:
-
To enable tab completion for SSH commands, add the following line to your shell's configuration file (e.g.,
~/.bashrc,~/.zshrc): -
Source your shell's configuration file:
or
Now, you can type ssh and press Tab to see a list of available aliases.