SourceForge VA Linux Systems
Copyright © 2000 Paul Sheer - Click here for copying permissions       Source by FTP

next up previous contents index
Next: LINUX resources Up: Rute Users Tutorial and Previous: User accounts and ownerships   Contents   Index

Subsections

Using Internet Services

Add comments here 
This chapter should make you aware of the various methods for transferring files and data over the Internet, and remotely accessing UNIX machines.

telnet and rlogin

telnet is a program for talking to a UNIX network service. It is most often used to do a remote login. Try

 
 
telnet <remote_machine>
telnet localhost

to login to your remote machine. It needn't matter if there is no physical network, network services always work regardless, because the machine always has an internal link to itself.

rlogin is like a minimal version of telnet that allows login access only. You can type

 
 
rlogin -l <username> <remote_machine>
rlogin -l jack localhost

if the system is configured to support remote logins.

FTP

FTP stands for File Transfer Protocol. If FTP is set up on your local machine, then other machines can download files. Type

 
ftp metalab.unc.edu

or

 
ncftp metalab.unc.edu

ftp was the tradition command-line UNIX FTP client15.1, while ncftp is a more powerful client that will not always be installed.

You will now be inside an FTP session. You will be asked for a login name and a password. The site metalab.unc.edu is one that allows anonymous logins. This means that you can type anonymous as your username, and then anything you like as a password. You will notice that it will ask you for an email address as your password. Any sequence of letters with a @ symbol will suffice, but you should put your actual email address out of politeness.
The FTP session is like a reduced shell. You can type cd, ls and ls -al to view file lists. help brings up a list of commands and you can also type help <command> to get help on a specific command. You can download a file using the get <filename> command, but before you do this, you must set the transfer type to binary. The transfer type indicates whether or not new-line characters will be translated to DOS format or not. Typing ascii turns this on, while binary turns it off. You may also want to enter hash which will print a # for every 1024 bytes of download. This is useful to watch the progress of a file. Goto a directory that has a README file in it and enter,

 
get README

The file will be downloaded into your current directory.

You can also cd to the /incoming directory and upload files. Try,

 
put README

to upload the file that you have just downloaded. Most FTP sites have an /incoming directory which is flushed periodically.

FTP allows far more than just uploading of files, although the administrator has the option to restrict access to any further features. You can create directories, change ownerships and do almost anything you can on a local file system.
If you have several machines on a LAN, all should have FTP enabled to allow users to easily copy files between machines. configuring the FTP server will be dealt with later.

finger

finger is a service for telling who is logged in on a remote system. Try finger @<hostname> to see who is logged in on <hostname>. The finger service will often be disabled on machines for security reasons.

Sending files by email

uuencode and uudecode

Mail is becoming used more and more for transferring files between machines. It is bad practice to send mail messages over 64 kilobytes over the Internet because it tends to excessively load mail servers. Any file larger than 64 kilobytes should be uploaded by FTP onto some common FTP server. Most small images are smaller than this size, hence sending a small JPEG15.2 image is considered acceptable.
To send files by mail if you have to is best accomplished using uuencode. This utility takes binary files and packs them into a format that mail servers can handle. If you send a mail message containing arbitrary binary data, it will more than likely be corrupted in the way, because mail agents are only designed to handle a limited range of characters. uuencode takes a binary file and represents it in allowable characters albeit taking up slightly more space.
Here is a neat trick to pack up a directory and send it to someone by mail.

 
 
tar -czf - <mydir> | uuencode <mydir>.tar.gz \
    | mail -s "Here are some files" <user>@<machine>

To unpack a uuencoded file, use the uudecode command:

 
uudecode <myfile>.uu

MIME encapsulation

Most mail readers have the ability to attach files to mail messages and read these attachments. The way they do this is not with uuencode but in a special format known as MIME encapsulation. MIME is way of representing multiple files inside a single mail message. The way binary data is handled is similar to uuencode, but in a format known as base64.
If needed, there are two useful command-line utilities in the same vein as uuencode that can create and extract MIME messages. These are mpack and munpack.

next up previous contents index
Next: LINUX resources Up: Rute Users Tutorial and Previous: User accounts and ownerships   Contents   Index
Paul Sheer 2000-10-07