<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web2.0 Tutorials &#187; ssh</title>
	<atom:link href="http://www.zulutown.com/blog/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zulutown.com/blog</link>
	<description>All the Guides You Need to Become a Web2.0 Expert</description>
	<lastBuildDate>Mon, 13 Jul 2009 07:50:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH Tunnelling to Remote Servers, and with Local Address Binding</title>
		<link>http://www.zulutown.com/blog/2009/02/28/ssh-tunnelling-to-remote-servers-and-with-local-address-binding/</link>
		<comments>http://www.zulutown.com/blog/2009/02/28/ssh-tunnelling-to-remote-servers-and-with-local-address-binding/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 18:10:52 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[mirc]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[tunnelling]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=85</guid>
		<description><![CDATA[It&#8217;s often required to open different kind of connections to a server where there is available just a SSH account (or where only the port 22 is open).
Using ssh tunneling it&#8217;s easy to to access any port on the server, or even to connect to any other servers reachable from the server where the SSH [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s often required to open different kind of connections to a server where there is available just a SSH account (or where only the port <code>22</code> is open).<br />
Using <em>ssh tunneling</em> it&#8217;s easy to to access any port on the server, or even to connect to any other servers reachable from the server where the SSH account is available.</p>
<p>To access directly (i.e. with MySQL Query Browser) a MySQL service on the remote server, where the access to the port <code>3306</code> is denied, the trick is to open a SSH tunnel to the remote server, mapping an arbitrary local port the the remote port <code>3306</code>. In the following example the local port <code>5306</code> is used:</p>
<pre>ssh -L 5306:remoteserver.com:3306 remoteuser@remoteserver.com</pre>
<p>In this case, the local port <code>5306</code> is forwarded (with ssh tunnelling) to <code>remoteserver.com</code>, that attaches the tunnel on its port <code>3306</code>.<br />
When the tunnel is open, it&#8217;s only required to setup MySQL Query Browser to connect on <code>localhost:5306</code> and the connection will be magically forwarded to the remote server on its port <code>3306</code>.</p>
<div id="attachment_86" class="wp-caption alignnone" style="width: 490px"><img class="size-large wp-image-86" title="Simple ssh tunnelling of a MySQL Connection" src="http://www.zulutown.com/blog/wp-content/uploads/2009/02/simple_ssh_tunnelling-480x223.png" alt="Simple ssh tunnelling of a MySQL Connection" width="480" height="223" /><p class="wp-caption-text">Simple ssh tunnelling of a MySQL Connection</p></div>
<p>It&#8217;s even possible to set the remote side of the tunnel to be mapped not on the remote server itself, but on a <em>different host</em>.<br />
For example, if the local computer is not allowed to access IRC servers, an idea could be to use a remote server where a SSH account is available to tunnel the IRC connections.</p>
<p>Here is an example:</p>
<pre>ssh -L 8666:ircserver.org:6666 remoteuser@remoteserver.com</pre>
<p>In this case the local port <code>8666</code> is mapped on the port <code>6666</code> of the IRC server <code>ircserver.org</code>, so the local IRC client (i.e. mIRC) should be simply setup to connect on <code>localhost</code> on the port <code>8666</code>.</p>
<div id="attachment_87" class="wp-caption alignnone" style="width: 490px"><img class="size-large wp-image-87" title="SSH Tunnelling to a Different Remote Host" src="http://www.zulutown.com/blog/wp-content/uploads/2009/02/ssh_tunnelling_to_a_different_remote_host-480x142.png" alt="SSH Tunnelling to a Different Remote Host" width="480" height="142" /><p class="wp-caption-text">SSH Tunnelling to a Different Remote Host</p></div>
<p>Finally, other people in the local network might desire to use the tunnel to the remote server (in this example it&#8217;s a IRC server). If the client that opened the SSH tunnel has the IP address <code>192.168.1.1</code>, the other clients on the local network should connect to <code>192.168.1.1:8666</code> to reach the remote ircserver.org on the port 6666.</p>
<p>In this last case, it&#8217;s important to make sure that the tunnel binds to the correct local IP address.<br />
If the local client has 2 addresses: <code>127.0.0.1</code> and <code>192.168.1.1</code>, it&#8217;s useful to open the tunnel binding it on <code>192.168.1.1</code>. In this way other clients on the LAN can use the tunnel. This is the syntax:</p>
<pre>ssh -L 192.168.1.1:8666:ircserver.org:6666 remoteuser@remoteserver.com</pre>
<div id="attachment_88" class="wp-caption alignnone" style="width: 490px"><img class="size-large wp-image-88" title="SSH Tunnelling with Local Address Binding" src="http://www.zulutown.com/blog/wp-content/uploads/2009/02/ssh_tunnelling_with_address_binding-480x126.png" alt="SSH Tunnelling with Local Address Binding" width="480" height="126" /><p class="wp-caption-text">SSH Tunnelling with Local Address Binding</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/02/28/ssh-tunnelling-to-remote-servers-and-with-local-address-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Executing Commands and Scripts Remotely with ssh</title>
		<link>http://www.zulutown.com/blog/2009/02/13/executing-commands-and-scripts-remotely-with-ssh/</link>
		<comments>http://www.zulutown.com/blog/2009/02/13/executing-commands-and-scripts-remotely-with-ssh/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 22:17:11 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[remotely]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=76</guid>
		<description><![CDATA[Often it&#8217;s required to execute on a remote server a command or a whole bash script.
Not everyone knows that through ssh it&#8217;s possible to execute this task.
Here&#8217;s the ssh syntax:
usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
    [...]]]></description>
			<content:encoded><![CDATA[<p>Often it&#8217;s required to execute on a remote server a command or a whole bash script.<br />
Not everyone knows that through <code>ssh</code> it&#8217;s possible to execute this task.</p>
<p>Here&#8217;s the ssh syntax:</p>
<pre>usage: ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w local_tun[:remote_tun]] [user@]hostname [command]</pre>
<p>In the following example , the <code>ls</code> command is run on the remote server.</p>
<pre>ssh remoteuser@remoteserver.com ls</pre>
<p>To run a local script on the remote server, it&#8217;s required to upload it (through <code>scp</code>), set it as executable and finally run it.</p>
<p>The related example:</p>
<pre>scp myscript.sh remoteuser@remoteserver.com:/remotedir/myscript.sh
ssh remoteuser@remoteserver.com "chmod +x /remotedir/myscript.sh"
ssh remoteuser@remoteserver.com /remotedir/myscript.sh</pre>
<p>Of course it&#8217;s required to type the password after each command (or to use a identity key file)</p>
<p>Looking through the <code>ssh</code> options it&#8217;s possible to find many other feature offered by this common command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/02/13/executing-commands-and-scripts-remotely-with-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying Files between Clients and Servers over ssh using scp</title>
		<link>http://www.zulutown.com/blog/2009/02/07/copying-files-between-clients-and-servers-over-ssh-using-scp/</link>
		<comments>http://www.zulutown.com/blog/2009/02/07/copying-files-between-clients-and-servers-over-ssh-using-scp/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 12:52:58 +0000</pubDate>
		<dc:creator>Zulutown Webmaster</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[copying]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[recursively]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[transfer]]></category>

		<guid isPermaLink="false">http://www.zulutown.com/blog/?p=73</guid>
		<description><![CDATA[It&#8217;s quite common to need to upload or download file between one or more servers and the local computer.
If it&#8217;s available a ssh access on the servers, using scp to transfer file from and to the server could be a very good option.
Here&#8217;s its syntax:
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
   [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s quite common to need to upload or download file between one or more servers and the local computer.</p>
<p>If it&#8217;s available a <em>ssh access</em> on the servers, using <code>scp</code> to transfer file from and to the server could be a very good option.</p>
<p>Here&#8217;s its syntax:</p>
<pre>usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2</pre>
<p>A very simple example:</p>
<pre>scp localfilename.txt remoteuser@www.remotehost.com:remotefilename.txt</pre>
<p>The previous example copies <code>localfilename.txt</code> from the local directory to the server <code>www.remotehost.com</code> using <code>remoteuser</code> as the ssh account to authenticate on the remote server. On the remote server the transferred file will be stored as <code>remotefilename.txt</code> in the default login directory of <code>remoteuser</code>.</p>
<p>Copying file from and to specific directories:</p>
<pre>scp /localdir/localfilename.txt remoteuser@www.remotehost.com:/remotedir/remotefilename.txt</pre>
<p>Compared to the previous example, in this case, the file is taken from <code>/localdir/localfilename.txt</code> and stored remotely on <code>/remotedir/remotefilename.txt</code>.<br />
Obviously <code>remoteuser</code> should have write permission on the remote directory where the file is going to be written.</p>
<p>In the next case, the authentication is made through a keyfile, this is the syntax:</p>
<pre>scp -i keyfile /localdir/localfilename.txt remoteuser@www.remotehost.com:/remotedir/remotefilename.txt</pre>
<p>In this case to login as <code>remoteuser</code> there will not be a prompt for password, but <code>keyfile</code> is used as identity file.</p>
<p>It&#8217;s even possible to copy directly files from one server to another</p>
<pre>scp firstremoteuser@www.firstserver.com:/filename.txt anotherremoteuser@www.anotherserver.com:/remotedir/remotefilename.txt</pre>
<p>Finally one of the best features is to copy recursively directory trees to the remote server:</p>
<pre>scp -r /localdirectory remoteuser@www.remoteserver.com:/remotedirectory</pre>
<p>In this case, the whole content of localdirectory is recursively copied into remotedirectory. This can be very useful for moving quickly website structures.<br />
I hope you&#8217;ve found some useful information in this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zulutown.com/blog/2009/02/07/copying-files-between-clients-and-servers-over-ssh-using-scp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
