File Transfer Tutorial

This tutorial discusses various ways to get data from and to a local (external) machine into and out of SDF.

Contents

To Do

  • x/y/zmodem transfers
  • kermit transfers

Introduction

To transport data between SDF and your local (or any other external) machine, there are various ways. Their availability depends on your member level on SDF (see the FAQ, MEMBER section for more information), the external system, and their connection.

FTP - File Transfer Protocol

FTP (File Transfer Protocol) on SDF is available only for downloading public files. This is for security reasons. For upload and download of private files, scp and sftp must be used.
Note: ARPA membership allows for up- & download via FTP; however, it is better to use scp or sftp if possible, as FTP is unencrypted, and your passwords also have to travel in the clear.

For download, point your FTP program to sdf.lonestar.org and do anonymous FTP to read data (username “anonymous”, password “yourlogin@sdf.lonestar.org”, or another of your e-mail addresses).

scp and sftp - secure copying and ftp

scp and sftp are secure ways to transfer data between computers, based on ssh (secure shell). If you've only worked with ftp before, you'll be surprised at the ease and benefits to using scp.

Let's say you're logged into sdf and you want to transfer some pictures from your home machine (named foo in this example) to your sdf home directory. You would want to use the following command:

scp *.jpg me@sdf.lonestar.org :/your/remote/home/

Let's break that down

scp: The command itself.
*.jpg: The files you want to transfer.
me@sdf.lonestar.org: Your username @ the server you wish to connect to.
:/your/remote/home/ : The directory you'd like to upload it.

Unless you've installed ssh authorization keys, you'll be prompted for your username and password. Afterwhich, you should have output similar to this:

[me@local Pictures]# scp *.jpg me@sdf.lonestar.org:~/your/remote/home
IMG_016.jpg 100% 1802KB 45.7KB/s 00:39
IMG_017.jpg 100% 1253KB 46.1KB/s 00:40
IMG_018.jpg 100% 1243KB 48.6KB/s 00:25
IMG_020.jpg 100% 1131KB 45.9KB/s 00:39
[foo@local Pictures]#

On SDF, you need to have ARPA membership to be able to use them. Check the manpages of scp and ssh for more information and options to use.

On Windows machines, you can use the PuTTY programs.

ssh and tar - securely copying directories

The tar archiving tool can be used with ssh to quickly duplicate whole directory trees:

tar cf - target_dir | ssh me@freeshell.org " tar xf - -C ~/path/ "

Note: this trick requires compatible versions of tar on the local and remote systems

Gopher and HTTP - using the internet for download

To get data out of SDF on a local machine, you can of course publish them on your gopher- or web-site. Please check the FAQ, GOPHER section and the website tutorial for information how to set up these sites.

Please note that HTTP traffic is bandwidth limited depending on your membership level; if you go over the quota, your site will be temporarily blocked!

To prevent access by everybody, see the FAQ entry about password protection of websites.

Terminal - direct copying via the terminal

For transferring small amount of text data (scripts, tables, source code snippets), think about copy/paste directly in the terminal! If you are MetaARPA, then you can use “screen” and its built-in copy facility to transfer data between different screens.

To append text input in the terminal to a file on SDF, you can open the file on SDF in your favourite text editor. Or simply use the command “cat » file”, send the data to the terminal (via the paste function), and finish with a single line containing only ^D (CTRL-D) - to do that in the terminal, hit RETURN, CTRL-D, RETURN; this will close the standard input the “cat” was reading from.

E-mail - for small files only

If you have to transfer binary data and cannot use scp (because you're not ARPA, which is a pity), then you may need to use file transfer via e-mail. For this, you attach the data you want to get into SDF to a message which you send to your address on SDF (yourlogin@sdf.lonestar.org). On SDF, you read the message and save the attachment where you need the data (e.g, in your home directory, from where you can move them using “mv”).

This may not work for large attachments, as the e-mail system (everywhere!) was not intended for file transfer. If you have to regularly transfer large files, you should seriously consider becoming ARPA!

Zmodem - Using Microsoft Hyper Terminal for File Transfer

Here I will be showing you all how to transfer file to and from a server through the Z-Modem Protocol using the hyper terminal tool.

Open up hyper terminal and create a connection to the server on port 23 using TCP/IP(Winsock).


Log in using your username and password.


If you want to upload a file to the server then use the “rz” command. This will set your connection on the server side to receive mode.


Now Send the file using the Z-modem protocol. Remember that since you are using “rz” on the server side you must match the same protocol for sending the f ile.

If you want to receive file from the server then set the same protocol that you are going to use on the server side for the receive mode.

Now just use the sz command on the server side to send the file.
$ sz  filename

Glossary

ARPA and MetaARPA

These are additional membership levels on SDF which allow for more commands and provide more space and the good feeling of supporting SDF

download

to get data from SDF to your local machine; imagine SDF sitting somewhere uphill so that everybody can see it - then you get the data down from SDF

PuTTY

PuTTY is a software suite for Windows machines for ssh and scp connections.

SDF

Super Dimensional Fortress - if you don't know what that is, then why are you reading this..? wink

terminal

The equipment used to connect to a computer in text mode (for a more accurate definition see the corresponding Wikipedia entry), or in a narrower context the window which gives access to a SDF in text mode. If you are using Windows, it may be a telnet window (or better use PuTTY for secure access via ssh - that's even possible without being ARPA), or on a Linux machine an xterm window.

upload

to get data to SDF from your local machine; see download

$Id: filetransfer.html,v 1.13 2012/05/29 05:33:25 credmon Exp $