|
/Admin/SSH-SSL:
Some SSH Tricks
You can re-use existing SSH connections by adding this to ~/.ssh/config file:
Host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
Thereafter, after you login and open a connection to an SSH server, if you open another connection from another terminal, it will re-use the first connection. No need to login again, no need to wait for the connection to be re-negotiated. Over a slow, long-distance SSH connection, this can slow the wait time from tens of seconds to two seconds. This applies to SCP transfers as well. Much saved time.
If you have a long list of servers you log into regularly, particularly on non-standard ports, these connections can also be aliased in the ~/.ssh/config file:
Thereafter, "ssh my-chosen-alias" will connect to root@server.com on port 10122. Unfortunately SCP does not seem to respect these aliases, or at least I have not found out how to make that work. But this is a way, for instance, to transparently get backuppc[1] to connect to a backup client using a non-standard port.Host my-chosen-alias Hostname server.com IdentityFile /path/to/id_rsa User root Port 10122
[1] http://blog.langex.net/index.cgi/Admin/backups/backuppc/
posted at: 05:22 | path: /Admin/SSH-SSL | permanent link to this entry