Speeding up SSH (ControlMaster)Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
So this speeds up login multiple times?
What's the advantage over 'just' using passwordless key authentication?
yes speed since you dont have the tcp connect overhead every connection
Permissions: it should be enough to set ~/.ssh (or ~/.etc/ssh, on MirBSD) to 0700 ― MirBSD default is ~/.etc is 0700, so that matches; pristine OpenSSH refuses to work if ~/.ssh is not 0700, so that also matches.
ControlMaster: set it to "no" and use "ssh -fNM " to initiate the master connection manually. Otherwise, if you have two terminals, run "ssh " on the first, then on the second, then quit it on the first, the terminal will be occupied by the ssh process until you quit it on the second as well. This is mostly annoying and contra-productive, especially with mc (ssh over commandline, fishfs), sshfs, etc. ControlPath: Be sure to append the "Host *" match at the VERY END of the file, so that you can override it in any entries placed before it (ssh_config(5) is last-match). For instance, if you have two aliases for the same host (say, "Host herch\n Hostname 192.168.x.y" and "Host hercv\n Hostname herc.vpn.xxx"), you want them to share a ControlPath, not use different ones. Advantage: you do not only not have the tcp connect overhead, but also the cryptographic overhead. This is especially good if one of the two boxen is slow. It also makes cvs-over-ssh (which is the One True Way™ to use cvs, unless you mirror the repo locally, which again is a good idea anyway for everything except cvs ci) a really nice experience, as commands are done almost instantly. Passwordless keys: bad bad bad. If you must, try to use ssh-agent and password-protected keys instead. Really. (There's even ssh agent forwarding, for the adventurous.) I have small scripts "m_0" and "m_1" which kill or create a master connection with/and a pidfile (using ctl. and pid., respectively).
I wrote an open source utility to managed background ControlMaster sessions: https://github.com/ClockworkNet/cmc
Add Comment
|
Calendar
QuicksearchSupportRecent Entries
CategoriesTag cloud23c3 acpi advertising annouce announce april argh art awards bash blogging bugs c cli code conferences config configuration data mining debconf debian dell dns documentation email errm? events exploit fail fail2ban filesharing films flame fun gcc google graphs grml gsm hacking hacks hardware heise images information installation internet irc knowledge libacpi links linux mobile phones network news newsbeuter omg open source opera passwords php power privacy programming qa random blurb rant release releases rss scripts security service setup shell sms software spam ssh stfl stuff terminal tests text mode tip tips tools troubleshooting unix user video vim.editing web web 2.0 websites wordpress wtf www youtube zsh
|