Jump to content

Recommended Posts

Posted

<div class="KonaBody"><p>If you use SSH even somewhat often, it would benefit you to setup a basic SSH config file. If you’re curious why, would you rather type something like this:</p>

<p><code>ssh -p 6851 user@servername.domain.com</code></p>

<p>Or just type:</p>

<p><code>ssh name</code></p>

<p>I know what I’d rather do, so let’s get this working. I’m going to use nano editor because it’s user friendly.</p>

<p>Launch the <a href="http://osxdaily.com/category/command-line/">Terminal</a> and type the following:</p>

<p><code>nano ~/.ssh/config</code></p>

<p>You’ll probably have a blank config file and that’s fine, so here’s what we’ll add to it:</p>

<p><code>host shortcutname

HostName server.domain.com

Port 5555

User username

</code></p>

<p>Here’s how this might look:</p>

<p><img src="http://osxdaily.com/wp-content/uploads/2011/04/ssh-config-example.gif" alt="" title="ssh-config-example" width="333" height="79" class="aligncenter size-full wp-image-14577" /></p>

<p>I keep things indented to make them easier to read but it’s not necessary. Once your server and login info is inputted, hit Control+O to save the file, then Control+X to quit out of nano. </p>

<p>Now you can just type the shorthand to connect to a server, such as ‘ssh osxd’ and the full hostname, port, and username will be included for you. </p>

<p>There are many more possibilities with SSH configs, if you want to check out more options just look at the manual page with “man ssh_config”</p>

<p>Check out some more <a href="http://osxdaily.com/category/command-line/">command line tips</a> while you’re at it.</p>

</div>

<p><a href="http://feedads.g.doubleclick.net/~a/pUmNC4hWynoQ7XB4clL-wfHWLc8/0/da"><img src="http://feedads.g.doubleclick.net/~a/pUmNC4hWynoQ7XB4clL-wfHWLc8/0/di" border="0" ismap="true"></img></a><br/>

<a href="http://feedads.g.doubleclick.net/~a/pUmNC4hWynoQ7XB4clL-wfHWLc8/1/da"><img src="http://feedads.g.doubleclick.net/~a/pUmNC4hWynoQ7XB4clL-wfHWLc8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">

<a href="http://feeds.feedburner.com/~ff/osxdaily?a=Y-do6ZB2xQk:KdAa6Ew31FY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=Y-do6ZB2xQk:KdAa6Ew31FY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=Y-do6ZB2xQk:KdAa6Ew31FY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=Y-do6ZB2xQk:KdAa6Ew31FY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=Y-do6ZB2xQk:KdAa6Ew31FY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=Y-do6ZB2xQk:KdAa6Ew31FY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=Y-do6ZB2xQk:KdAa6Ew31FY: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/Y-do6ZB2xQk" height="1" width="1"/>

 

View the full article

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days


×
×
  • Create New...