Chapter 2: Using the network

Table of contents

Chapter 2

Using the network

Other chapters in this book cover basic network concepts, configuration, and administration. This chapter helps you get started quickly using the network and points you to additional documentation for more information. It presents step-by-step procedures for the following basic networking operations: In addition to the material presented here, you may also find it useful to: The procedures presented here are the surest and simplest if you are new to using a network. For additional conceptual information, refer to Chapter 1, ``Networking overview'', and the previous chapters in this guide.

Access privileges

On a network with machines belonging to several different groups of people, care must be taken to:

For system-wide control, the system administrator can create entries in the /etc/hosts.equiv file to establish who has network access to a particular machine. By placing in this file the name of another machine on the network, the system administrator establishes system equivalence. When another (remote) machine has system equivalence with your local machine, you can log in from your account on the local machine to your account on the remote machine without entering a password. See the hosts.equiv(SFF) manual page for more information.

You, as an individual user, can control who has access through the network to your account by using the User Equivalence Manager to add user equivalence. If the system administrators have not established system equivalence between two machines on which you have accounts, you can use this manager to create your own user equivalence between your accounts on the two machines. You can also create user equivalence to your account for any other user.

System or user equivalence applies only to the rlogin, rcp, and rcmd commands. With rlogin, if no equivalence is established, it prompts for a user name and password; if equivalence exists, rlogin skips this step. You cannot use the rcp and rcmd commands unless system or user equivalence exists.

Finding out networking names

Each machine on a network has a unique name. Generally, each user within a site also has a unique user name. You should know the name of your own machine and the name of any machine with which you want to communicate over the network. Also you should know the user name of any person to whom you want to send mail. Because you might not remember these various names, several simple network commands can provide this information.

You can find out the name of your own machine using the hostname(TC) command without any arguments. (A machine on the network is sometimes called a host.) The response is the name by which your machine is known on the network.

To see a list of the names of other machines on your network, use the ruptime command. (The ``r'' in the command name stands for remote. Remote refers to a machine across the network; your own machine is known as the local machine.) The output from the ruptime command shows the amount of time each machine has been up on the network:

seattle     up 26 days, 15:00, 1 user, load average: 2.08, 2.01, 2.00
berlin      down         4:07
sydney      up 43 days  01:27, 4 users, load average: 3.00, 3.00, 3.00
See the ruptime(TC) manual page for an explanation of the status information provided about each machine.

You may also be able to view a list of machine names stored in the file /etc/hosts. This file contains a listing of machine names and their Internet (IP) addresses.

To find out a person's user name, use the finger command and give the person's first or last name. For example, for a person named Rebecca Simpson, you might enter:

finger simpson

The response might be something like this:

Login name: rsimpson                 	In real life: Rebecca Simpson
Directory: /u/rsimpson               	Shell: /bin/sh
No Plan.
You now know that you can send mail to Rebecca through her user name rsimpson. See the finger(C) manual page for more information.

Logging in to a remote machine

Suppose that while you are working on your machine, you need to edit a file on a machine called seattle. You can use the telnet(TC) program to log in to seattle.

Give the telnet command with the name of the other machine:

telnet seattle

When telnet connects to the other machine, it prompts for your user name and password on that machine so you can log in:

   Trying...
   Connected to seattle.
   Escape character is ``^]''.
   

login: rsimpson Password:

You can do any kind of work at the command line on the other machine (such as use vi(C) for interactive editing) just as you would if you were working on a terminal directly connected to that machine. You cannot use icons or perform other graphics-oriented tasks on the remote machine, unless you set the DISPLAY environment variable to the local machine (see ``Using environment variables'' in the SCO OpenServer Handbook) and enable remote X access (see .``Step 2: Setting temporary display access'' in the Graphical Environment Guide)

When you are finished with your work, log out from the remote machine to end the remote terminal session and return to your local machine. If, for some reason, you cannot end a remote session normally, you can use the telnet escape character (<Ctrl>-]) to abort the session. (This escape character is not the same as the <Esc> key on your keyboard. To produce the telnet escape character, hold down the <Ctrl> key and type a closing square bracket). When you cannot log out from another machine normally, type <Ctrl>-] on a line by itself, and telnet displays its command prompt:

   telnet>
Enter quit to disconnect from the remote machine and return to your local machine.

You might also need to use the telnet quit command if the machine you are trying to log in to is not available or if you ever try to log in to a remote machine that telnet does not know about (either you mistyped the machine name or the machine is not on your network). In either of these situations, instead of seeing a login prompt for the remote machine, you see an error message saying "unknown host" or "Connection timed out" followed by the telnet prompt. Enter quit to exit from telnet command mode.

Other commands are available from telnet command mode. Sometimes you might temporarily leave the remote session with the escape character to use more telnet advanced features; you can later return to the remote session without logging in again. If you enter ``?'' at the telnet prompt, you see a list of all the telnet commands. The telnet(TC) manual page describes in detail how to use these commands.

Transferring files

While working on your own machine, you may decide that you want a copy of a new calendar file that exists on the remote machine seattle. If you simply want to copy a file from one machine to another, you do not need the kind of terminal session that telnet provides; instead, you can use ftp(TC), a file transfer program.

Give the ftp command with the name of the other machine:

ftp seattle

ftp connects to the other machine and prompts for a user name. If you want to log in with the default user name shown in parentheses within the prompt, simply press <Return>; otherwise, enter a user name on the remote machine. Then, enter the password for the user on the remote machine.

   Connected to seattle.
   220 seattle FTP server (Version 4.160 #9 Mon Mar 27 08:35:11 PST 1989) ready.
   Name (seattle:rsimpson):
   331 Password required for rsimpson.
   Password:
   230 User rsimpson logged in.
   ftp>
When your user name and password are verified, you can enter ftp commands at the prompt. ftp displays several messages about what it is doing, because it operates in verbose mode by default. If you prefer not to see these extra messages, you can toggle verbose mode off by entering the verbose command at the ftp prompt. (The rest of the ftp examples in this guide were created with verbose mode turned off.)

To copy the file calendar94 from the other machine to your machine, use the get command followed by the file's pathname on the remote machine and the pathname on your machine where you want ftp to place the file:

   ftp> get /usr/local/bin/calendar94 /u/rsimpson/bin/calendar94
   ftp>
ftp places a copy of the remote file calendar94 in your home bin directory on the local machine. In verbose mode, ftp notifies you when your local machine has received the new file, specifying the number of bytes transferred and how much time the transfer took.

The put command, which works just like get, allows you to copy a file from your machine to the remote machine. The syntax is:

put source destination

source is the pathname of the file on your machine that you want to copy; destination is the pathname on the remote machine where you want to put the file.

The ftp program has many other commands. At the ftp prompt, you can enter ``?'' to see a list of available commands (see the ftp(TC) manual page for descriptions). To end the ftp session, enter quit to disconnect from the remote machine.

Running commands remotely

Sometimes you only want to run a simple command on another machine. For example, if you want to use ls(C) to see which programs are in the /usr/local/bin directory on the remote machine seattle, you do not need a telnet terminal session because ls is not an interactive program like the vi editor. Likewise, you do not need the kind of interactive file access ftp provides. Instead, you can use rcmd(TC) to run the ls command on the remote machine without logging in to that machine.

You can only use rcmd if you have user or system equivalence with the remote machine (see ``Access privileges'') and if that machine is running a UNIX operating system. Give the rcmd command with the name of the other machine and the command that you want to execute remotely:

rcmd seattle ls /usr/local/bin

rcmd displays the output from the remote command on your screen:

   acctinfo
   bugreport
   calendar94
For examples of other ways to use the rcmd command, see the manual page for rcmd(TC).

Accessing shared files

Although the networking commands telnet, ftp, and rcmd provide extremely useful access to files on other machines, your network can be even more useful if you have a distributed filesystem. In a distributed filesystem, you can read, edit, delete, and otherwise access files on another machine just as if the files were on your local machine.

Your SCO OpenServer Desktop or Enterprise System provides filesharing capabilities between other SCO OpenServer systems, via the Network File System (NFS), as well as between SCO OpenServer systems and other operating systems. These capabilities are provided by:


When NFS is configured by your system administrator on your network, you will be able to transparently access and manipulate files on other machines as if they were local to your machine.