Skip to content

Using University of Manchester HYDRA server

Louis Maddox edited this page Feb 11, 2016 · 2 revisions

Automate secure passwordless login/file sync with SSH keys

Logging into the University of Manchester HYDRA server:

ssh username@hydra.itservices.manchester.ac.uk

Assuming already generated SSH keys for use with GitHub (see notes on regenerating them if needed), no need to run ssh-keygen and ssh-add to store keys in a keychain (for secure handling with ssh-agent).

  • After sshing into the server, ls ~/.ssh/authorized_keys will show the presence of keys on the server, i.e. it supports SSH key automated logins rather than manual password each time
  • run ssh-copy-id username@hydra.itservices.manchester.ac.uk to add your SSH key to the server, provide the server your password to confirm
  • the above ssh command will no longer prompt for a password, nor will scp/rsync.

Alias ssh

Add to (local) .bashrc:

alias hydra="ssh username@hydra.itservices.manchester.ac.uk"

Logging into the HYDRA server is now just hydra

Automatically start tmux

[dotfiles/server/.bashrc]

Add to (server) ~/.bashrc:

# Load tmux

if command -v tmux>/dev/null; then
        if [ ! -z "$PS1" ]; then
                [ -z $TMUX ] && tmux
        fi
fi

[dotfiles/server/.tmux.conf]

Add to (server) ~/.tmux.conf:

unbind C-b
set -g prefix C-a
bind C-a send-prefix

set -g mode-mouse on
set -g mouse-resize-pane on

(Assuming default Ctrl+B keybinding has not been changed) your local and server tmux instances obviously cannot share the same keybindings, meaning Ctrl + B cannot be used for using tmux on the server, Ctrl + arrow keys cannot be used for resizing its panes either. Set Ctrl + A and turn on mouse mode (to click and drag pane boundaries instead). Also requires holding Shift when highlighting text to copy (Ctrl + C).

Clone this wiki locally