Skip to content

Tear free

Eamon O'Dea edited this page Aug 9, 2018 · 7 revisions

For those coming to the world of the command line and remote servers from the world of user-friendly graphical interfaces, there can be tears of pain that accompany the tears of joy that result from the discovery of new powers. The command line can seem to be a very inconvenient and unpleasant way to interact with a computer. However, many of the irritants that result from working on the command line can be avoided by using a few convenient tools or configuration options. This page collects those which are likely relevant to Drake lab members.

How to store SSH connection settings

Windows users using putty can store the IP address and hostname for a frequently used SSH server in a menu entry as described in the manual. Linux and Mac users can achieve the same effect by creating an entry in the file at ~/.ssh/config. My work computer has the following entries:

Host monster
  Port 22
  Hostname 172.18.244.86
  user ebodea
  IdentitiesOnly yes
  IdentityFile ~/.ssh/id_rsa

Host gradmonster
  Port 9922
  Hostname 172.18.244.88
  user ebodea
  IdentitiesOnly yes
  IdentityFile ~/.ssh/id_rsa

Host croom
  User drakelab
  Hostname 172.18.244.94
  IdentityFile ~/.ssh/id_rsa

With this configuration, I can easily connect to the Drake lab computers using the shortcut names monster, gradmonster, and croom. For example, to connect to the high-memory machine OSE-WS148, I simply enter ssh gradmonster. No need to remember the nonstandard port number and the IP address! This example configuration can simply be pasted into your own computer's ~/.ssh/config, with the user ebodea changed to your own username, for you to avail yourself of this convenience. You of course also want to choose less (or more) silly names for the shortcuts. Further details on the possible uses of .ssh/config are described in the ssh_config man page. One such detail is worth quoting here: "Because of the potential for abuse, this file must have strict permissions: read/write for the user, and not accessible by others." Such permissions can be set by running the command chmod 600 ~/.ssh/config.

Lab Links

Clone this wiki locally