Automatic attach to Tmux session over ssh
=========================================

With the help of `~/.ssh/config' we can automaticly attach
to a tmux session when logging in.

Example ssh configuration
-------------------------
Here's an example for your `~/.ssh/config':

    Host tmux-on-superserver
        Hostname my.super.server
        IdentityFile ~/.ssh/id_mykey
        User <remote-user-name>
        RequestTTY yes
        RemoteCommand tmux a

Just run the command `ssh tmux-on-superserver' will login
to the server and also connect to the tmux session.

Adjust that last line when you have multiple sessioss running
on the remote host.

I discovered this with the help of Axels blogpost:
http://noone.org/blog/English/Computer/Shell/Starting%20a%20GNU%20Screen%20session%20via%20ssh_config.html

Happy ssh-ing!


Last edited: $Date: 2024/03/09 10:20:37 $