<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/ssh-sshfs-scp-sftp">
  <channel>
    <title>ssh sshfs scp sftp</title>
    <link>https://www.linuxjournal.com/tag/ssh-sshfs-scp-sftp</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Accessing Remote Files Easily and Securely</title>
  <link>https://www.linuxjournal.com/content/accessing-remote-files-easy-and-secure</link>
  <description>  &lt;div data-history-node-id="1021977" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/rj45.jpg" width="240" height="240" alt="A network connector" title="CC-BY http://www.flickr.com/photos/mafergo/" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/johan-thelin" lang="" about="https://www.linuxjournal.com/users/johan-thelin" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Johan Thelin&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;The secure shell, ssh, and its companion, scp, are tools that I use more or less on a daily basis. Being able to move files between machines without having to setup SAMBA or NFS is very handy when working with multiple systems. All that you need is to enable the secure shell daemon - sshd.&lt;/p&gt;
&lt;p&gt;Before we go into the details of the sshfs, let's run through a quick re-cap of ssh. The secure shell daemon runs on port 22 by default. It makes it possible to run an encrypted shell session. With the -Y flag, you can even run X11-forwarding, allowing you to run X11, i.e. graphical, programs on the remote machine and displaying the windows on the terminal that you are sitting at.&lt;/p&gt;
&lt;p&gt;You can configure sshd through the /etc/ssh/sshd_config file (that is the location on my Kubuntu machine). Here, you can disable root access, older protocols, X11 forwarding, etc. The notion is that the more limits you put on the remote access, the more secure your system is from potential attacks. You might also want to tune your hosts.allow and hosts.deny files if you plan to expose sshd to the Internet. There are many guides on hardening servers and ssh, so I will not go into details.&lt;/p&gt;
&lt;p&gt;To get things up and running, what you need to do is to install sshd. In Ubuntu, that means the openssh-server package. For external access, you also need to enable port forwarding of port 22 in your router/firewall and find your &lt;a href="http://www.whatismyip.com/"&gt;external IP&lt;/a&gt;. Now, you should be able to log onto your machine using your normal user credentials.&lt;/p&gt;
&lt;pre&gt;$ ssh user@192.168.1.100
user@192.168.1.200's password:&lt;/pre&gt;&lt;p&gt;Having entered the password, you should now have full access to the remote system.&lt;/p&gt;
&lt;p&gt;The handy scp command, secure copy, works in much the same way. To copy the file test.txt  to user's remote home directory, simply enter:&lt;/p&gt;
&lt;pre&gt;$ scp test.txt user@192.168.1.100:&lt;/pre&gt;&lt;p&gt;As before, you will be prompted for a password. You can copy the other way around as well. The command below demonstrates how to copy a file with an absolute path, i.e. not in the home directory of user, to your local machine.&lt;/p&gt;
&lt;pre&gt;$ scp user@192.168.1.100:/var/log/messages remote-messages&lt;/pre&gt;&lt;p&gt;These two commands means that you can browse the file system, and freely copy files between machines. What sshfs does is that it exposes this functionality as a file system that you can mount. Before we look into how, let's have a quick look at sshfs.&lt;/p&gt;
&lt;p&gt;The sshfs is implemented using &lt;a href="http://fuse.sourceforge.net/"&gt;FUSE&lt;/a&gt;, and relies on the sftp part of ssh to access the remote computer. As a remote file access protocol, sshfs is not very good. For instance, multiple users writing to the same file at once can create havoc. The benefits are the inherit security and that it is easy to setup.&lt;/p&gt;
&lt;p&gt;So, how to use it. Let's look at a very short demonstration.&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/accessing-remote-files-easy-and-secure" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Mon, 27 Jun 2011 13:00:00 +0000</pubDate>
    <dc:creator>Johan Thelin</dc:creator>
    <guid isPermaLink="false">1021977 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
