The Living Thing / Notebooks :

ssh

and other remote shells I s'pose

SSH, the secure shell, is the Swiss army knife of the internet. It lets you shunt data from one place to another with little fuss. Moreover, anything which is less fuss is in fact a gaping security hole and should not be allowed.

Extra security

You also need to secure ssh. If you want to be extra sensible, you could secure it using modern cryptography standards, such as elliptic ciphers, and smart defaults which are suspected to be less vulerable. You’re still screwed if cheap quantum factorization becomes a thing, though.

ProxyJump

ProxyJump Magical 2 step proxy!

  ssh -J your.jump.host remote.internal.host

or

scp -o 'ProxyJump your.jump.host' myfile.txt remote.internal.host:/my/dir

ssh-agent

As github mentions

Start ssh-agent on startup, but not if it’s already running: See Joseph M. Reagle’s solution:

SSH_ENV="$HOME/.ssh/environment"

function start_agent {
    echo "Initialising new SSH agent..."
    /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
    echo succeeded
    chmod 600 "${SSH_ENV}"
    . "${SSH_ENV}" > /dev/null
    /usr/bin/ssh-add;
}

# Source SSH settings, if applicable

if [ -f "${SSH_ENV}" ]; then
    . "${SSH_ENV}" > /dev/null
    #ps ${SSH_AGENT_PID} doesn't work under cywgin
    ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
        start_agent;
    }
else
    start_agent;
fi

ssh-agent and OSX

things are weird for OSX because you can store things in ssh-agent, or osx keychain, or some weird hybrid options that make my eyes cross. Apple’s Explanation is sorta clear and at least current. git has an opinion on it.

SSH old OSX behaviour for the vexed

tmux

You can use this on your local machine, but you can do all kinds of stuff on your local machine. Is extra amazing for remote admin.

Here are some intros to tmux: 1, 2.

Alternatives/extensions

mosh (“mobile shell”) is a shell for intermittent connections.

How is mosh better than tmux + ssh, though? I need a Venn diagram of features here.

Enterprise ssh? teleport.

To mention