Tmate is a remote tmux session over ssh.
$ brew update && brew upgrade
$ brew install tmux
$ brew install reattach-to-user-namespace
$ brew install tmate
Install the following to ~/.tmux.conf
# **** replace 'bash' with the shell that you use ****
set-option -g default-command "reattach-to-user-namespace -l bash"
set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
set-option -g default-terminal "screen-256color"
set -g history-limit 500000
set-option -g renumber-windows on
bind-key C-b last-window
# Start tab numbering at 1
set -g base-index 1
set -s escape-time 0
bind | split-window -h
bind - split-window -v
$ tmate
$ tmate show-message
Thu Feb 15 11:55:57 2018 [tmate] Connecting to ssh.tmate.io...
Thu Feb 15 11:55:57 2018 [tmate] Note: clear your terminal before sharing readonly access
Thu Feb 15 11:55:57 2018 [tmate] web session read only: https://tmate.io/<url>
Thu Feb 15 11:55:57 2018 [tmate] ssh session read only: ssh <key>@fk2.tmate.io
Thu Feb 15 11:55:57 2018 [tmate] web session: https://tmate.io/t/<key>
Thu Feb 15 11:55:57 2018 [tmate] ssh session: ssh <user>@fk2.tmate.io