<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE artikkel
        PUBLIC "-//infoweb.ntnu.no//DTD Infoweb 1.0 //NO"
        "http://infoweb.ntnu.no/infoweb.dtd">
<artikkel spraak="en">
  <tittel>sftp - Secure FTP</tittel>
  <forfatter>overhold</forfatter>
  <sammendrag>Information about SFTP and what to do when regular FTP 
    does not work anymore.
  </sammendrag>
  <lenker></lenker>
  <hoveddel>
    
    <os2>Transition from FTP to SFTP</os2>

    <avsnitt>The FTP-protocol does not support encryption. That means
      that all data transferred, including username and password, is
      transferred as clear text. Therefore, the FTP-protocol is considered
      insecure.
    </avsnitt>

    <avsnitt>If someone uses a packet sniffer between the FTP-client and
      the FTP-server, they can easily pick username and password and
      potentially abuse it.
    </avsnitt>

    <avsnitt>To avoid this problem, System Management has decided to not support
      FTP on their system.
    </avsnitt>

    <avsnitt>SFTP is FTP's successor.</avsnitt>

    <avsnitt>When you use SFTP you actually connect the server with the 
      aid of SSH. A SFTP-server is started and you connect to this server
      through the SSH-connection you already have. There are different
      clients which will do this automatically for you.
    </avsnitt>

    <os2>Windows</os2>

    <avsnitt>There are a several clients for Windows with a graphical user
      interface. Windows-users usually prefer graphical clients, so we will
      explain some clients here. If you prefer command line client, read the
      Linux/Unix-part at the end of this article. Some of this information may apply to command
      line clients in Windows.
    </avsnitt>

    <avsnitt>
      <ekstern uri="http://www.ssh.com/support/downloads/secureshellwks/non-commercial.html" tittel="SSH Secure Shell Client 3.2.9">
	SSH Secure Shell Client 3.2.9</ekstern> is a commercial client from SSH 
      Communications Security.  The client is free for evaluation, non-commercial
      and university use.
    </avsnitt>

    <avsnitt>This client is pretty easy to use. Just start the SSH Secure File
      Transfer Client-program. Press the <kommando>Quick Connect</kommando> button.
      The server name should be <trykk>sftp.stud.ntnu.no</trykk> and the port number
      should be 22. Then press <kommando>Connect</kommando>.
    </avsnitt>

    <avsnitt>If this is the first time you connect to a server, you will be asked
      to add the server. Just answer Yes. Next you will be asked to provide a password.
    </avsnitt>

    <avsnitt>You will see the files from your home directory on the server in the
      right frame and local files in the left frame. Just drag'n'drop files to/from
      the server/your local machine.
    </avsnitt>
    
    <avsnitt>
      <ekstern uri="http://winscp.sourceforge.net/eng/" tittel="WinSCP 3.6.1">
	WinSCP 3.6.1</ekstern> is open source SFTP- and SCP-client for Windows
      which uses SSH.
    </avsnitt>

    <avsnitt><uthev>F-Secure SSH File Transfer</uthev> is a part of the F-Secure
      SSH Client. This client resembles the explorer view in Windows.
      You can borrow a CD with the F-Secure SSH Client from
      <ekstern uri="http://www.orakel.ntnu.no/#kontakt" tittel="Orakeltjenesten">
	Orakeltjenesten</ekstern>.</avsnitt>

    <avsnitt>The connection procedure for F-Secure SSH File Transfer is the same
      as the connection procedure for SSH Secure File Transfer Client.
    </avsnitt>

    <avsnitt>To download a directory or file you can select it with the right
      mouse button. Choose <kommando>download</kommando> and browse to the
      destination directory. You can also use standard drag'n'drop functionality.
    </avsnitt>

    <avsnitt>To upload, you can use drag'n'drop. You can also press
      <kommando>the up arrow</kommando> on the button bar or choose
      <kommando>Operation->Upload</kommando>. Browse for the file/directory you
      want to upload, and press <kommando>upload</kommando>.
    </avsnitt>

    <os2>Linux/Unix</os2>

    <avsnitt>There are several different SFTP-clients for Linux/Unix. Here is a
      presentation of some of them.
    </avsnitt>

    <avsnitt><uthev>Konqueror</uthev> is a web browser/file browser, which is a
      part of the KDE Desktop Environment. Newer versions of Konqueror supports
      SFTP. To use the SFTP-functionality you have to use sftp://user@host as
      the URL. You will be prompted for a password. When you are connected your
      home directory will be available as a regular directory in Konqueror.
    </avsnitt>

    <avsnitt>To make it easier to use Konqueror as a SFTP-client you can split
      the window into two frames. To achieve this use the Window-menu, and choose
      <kommando>Split View Left/Right</kommando> or <kommando>Split View Top/Bottom
      </kommando>.
    </avsnitt>

    <avsnitt>Select the frame you will use for the SFTP-connection and enter the
      URL e.g. <trykk>sftp://user@sftp.stud.ntnu.no</trykk>. In the other frame
      browse to the source/destination directory you want to use. Now you can
      drag'n'drop files between the frames. You can choose to either copy or move
      files. Choose what you prefer.
    </avsnitt>

    <avsnitt><uthev>gftp</uthev> is a FTP-client that supports SFTP. This client
      has to be configured a bit to connect properly to our system. We will show
      you the minimal configuration to get things working, and leave further
      configuration to the user.
    </avsnitt>

    <avsnitt>When you run gftp you will get 8 menus (gftp 2.0.13). From the left
      these menus are: <uthev>FTP</uthev>, <uthev>Local</uthev>, <uthev>Remote</uthev>, 
      <uthev>Bookmarks</uthev>, <uthev>Transfers</uthev>, <uthev>Logging</uthev>, 
      <uthev>Tools</uthev> and <uthev>Help</uthev>.
    </avsnitt>

    <avsnitt>First we have to configure the SSH-options in such a way that it works
      on our system. Enter the Options-menu (<kommando>FTP->Options</kommando>,
      or <tast>Ctrl+O</tast>). You will see a new window with 7 tabs. From the left:
      <uthev>General</uthev>, <uthev>Network</uthev>, <uthev>FTP</uthev>, 
      <uthev>HTTP</uthev>, <uthev>SSH</uthev>, <uthev>Local</uthev> and 
      <uthev>Hosts</uthev>. First choose the <uthev>Network</uthev>-tab. Change the
      <trykk>Default Protocol</trykk> (at the bottom) to <trykk>SSH2</trykk>. Then
      choose the <uthev>SSH</uthev>-tab. You will find three checkboxes. Mark the
      <trykk>Use SSH2 SFTP subsys</trykk> checkbox.
    </avsnitt>

    <avsnitt>The client is now configured to interact properly with our system. The
      next step is to check the connection. In the host-field enter e.g.
      <uthev>sftp.stud.ntnu.no</uthev>. In the user-field enter your username. Press
      the <kommando>Connect</kommando>-button to the left. You will be prompted for
      a password. When you are connected, your home directory will appear in the right
      frame. You can use drag'n'drop-functionality to copy files.
    </avsnitt>

    <avsnitt><uthev>sftp</uthev> is a command line program, which is a part of the
      OpenSSH package. sftp works almost like regular command line ftp in dos and 
      unix. You use the command <kommando>sftp user@host</kommando> to connect to
      a sftp-server.
    </avsnitt>

    <avsnitt>Type <kommando>help</kommando> when you are connected to list available
      commands and a description of these.
    </avsnitt>

  </hoveddel>
</artikkel>
