Geek Posted April 11, 2011 Posted April 11, 2011 <div class="KonaBody"><p>More fun with SSH! We showed you how to setup <a href="http://osxdaily.com/2011/04/05/setup-ssh-config-fie/">SSH config files</a> and use <a href="http://osxdaily.com/2011/04/06/enable-tab-completion-for-ssh-aliases/">tab completion for SSH aliases</a>, but setting up bash aliases is even easier if you are connecting to the same server over and over again.</p> <p>Here’s what you’ll need to do:</p> <p><code>nano ~/.bash_profile</code></p> <p>On a new line, enter something like this:</p> <p><code>alias servername='ssh -p 888 user@server.domain.com'</code></p> <p>Hit Control+O to save then Control+X to exit nano, and relaunch the Terminal.</p> <p>Now you only have to type ‘servername’ and off you go.</p> <p>A few of our commenters pointed this out as an even easier method to connect to a server than setting up a config file specifically for SSH. Thanks for the input everyone.</p> </div> <p><a href="http://feedads.g.doubleclick.net/~a/75Pp44NSOt6CDs7rJ_q2zQR7UdM/0/da"><img src="http://feedads.g.doubleclick.net/~a/75Pp44NSOt6CDs7rJ_q2zQR7UdM/0/di" border="0" ismap="true"></img></a><br/> <a href="http://feedads.g.doubleclick.net/~a/75Pp44NSOt6CDs7rJ_q2zQR7UdM/1/da"><img src="http://feedads.g.doubleclick.net/~a/75Pp44NSOt6CDs7rJ_q2zQR7UdM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare"> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6tzoIg4nZ14:4kaKecJTnBg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6tzoIg4nZ14:4kaKecJTnBg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=6tzoIg4nZ14:4kaKecJTnBg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6tzoIg4nZ14:4kaKecJTnBg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=6tzoIg4nZ14:4kaKecJTnBg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6tzoIg4nZ14:4kaKecJTnBg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6tzoIg4nZ14:4kaKecJTnBg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/6tzoIg4nZ14" height="1" width="1"/> View the full article
Recommended Posts