Networking Title

Commands covered in this section: rlogin telnet sz rz ping finger who rwho talk write mesg

Logging into Remote Computers

There are times when you will need to log into a remote computer to do this there are several commands available on the UNIX systems. Use rlogin hostname to log into the computer called hostname. You will be accessing that computer as if it was the machine you are using, this means that your environment settings will be effective for that rlogin (the shell that account is set-up with will be operational, so if you are using zsh and that account is set to use bash on login you will be using the bash shell). On occasions the need may arise for you to log into a remote host using another userid. to do this use rlogin -l userid hostname. This will allow you to log into hostname under a different identity, which will remain effective during that session.
Note: Some UNIX systems inverse the order of the hostname and userid so if the example given above does not work use rlogin hostname -l userid.
You will need to have a password for the account you are trying to log into or have permission to use it without a password.



Using Telnet

Telnet is a well known internet utility and as such it is available on most systems, the most important difference between rlogin and telnet is that you cannot use rlogin with PC based networks, it will only work on UNIX networks. To access PC networks use telnet

Type telnet hostname to connect directly to the machine specified by hostname, if you want to connect to a specific port type telnet hosname port (note, space required). The hostname can be either a full name such as crocus.csv.warwick.ac.uk or it can be a simple IP address as 128.83.165.133 If you just type telnet without supplying a hostname you will get the telnet prompt which looks as this: telnet> at this prompt you can use any of the telnet commands described bellow.
Note: To use any of these command s you will need to be at the telnet prompt, if you are in a telnet session to escape use Ctl & ] to get to the prompt (you connection to the remote computer will not be lost).

CommandShort FormatParametersAction
openohostname (port)Opens a new telnet connection to remote computer
closecnoneCloses your current connection to remote computer and returns you to the telnet prompt
quitqnoneAs close but exits from the telnet utility completely.
statusstnoneDisplays telnet status



Advanced Telnet Use

Telnet provides may option allowing you to make more advanced use of the networking facilities offered by UNIX, we will here describe a few of the most commonly used.
z allows you to either suspend telnet and return to your shell or to start a subshell, this will mostly depend on your system set-up, but the end result will be practically the same, you will be working in your sub/shell while the remote connection is suspended. On most UNIX systems this means that you will be able to use rz or sz to receive (or send) files via the Zmodem transfer protocol.(see bellow)
m or mode Will allow you to change the modes of transmission between the two computers. This will effect the speed of transfer as well as the way the data is transferred(note: both computers need to support these option for mode to work, try it, if it starts complaining, it doesn't support that mode!).

sz amp rz

These two utilities are used in conjunction to telnet to send and receive files using the Zmodem Protocol. Use the z telnet command as described above, then type binary on to switch from ASCII transfer to binary transfer, start the rz in the background by typing bg rz. This will cause the system to wait for a Zmodem transfer. Then bring the telnet session back to the foreground (see section on Controlling Processes for details on how to use fg bg, ...) and start the sending the file in Zmodem.
Because of the wonders of the Zmodem Protocol all the necessary setting will be in set-up by the two computers and the file transmitted, once the rz job is finished your file will be received. To send a file use the same procedure but type bg sz filename, and instruct the remote computer to receive the file.



Computer Status

Telnet connections refused? Unable to rlogin? The computer you are trying to access might be down. To find out if it is the remote computer or your utility type ping hostname . This give you either hostname is alive or hostname is not responding (some say dead!).
If when you type ping hostname you get no response for a long time, then the remote computer is either dead or remote connections have been disabled. Try later!



Finding all about a Remote User

There are time, when we need to (or would like to) know as much as possible about a given user. To do so use finger userid This will give you something like:

[localhost]
Login name: lauvj In real life: Mr F Blaskovic
Directory: /home/crocus8/la/uvj
Shell: /usr/local/bin/zsh
Mr F Blaskovic (lauvj) is not presently logged in.
Last seen at crocus on Sun Aug 18 12:39:05 1996 from somewhere.com
Mail forwarded to someplace.on.the.net

This is the long version of the output given by finger. (which is usually the default on localhosts). If it isn't the default use finger - l userid, or if it is the default and you want the short format use finger -s userid.
If you have a file called .plan or .project, those will be displayed. Note in the above example there is a reference to main being forwarded followed by the address to where the mail is forwarded. This will be displayed if the user has a .forward file in their home directory.
If you don't want to wait for finger to display the .plan, .project or .forward files use finger -p userid.


Use finger -options userid@hostname to find a user at hostname, or any user that matches the string userid. If you are on a network with several hosts instead of using finger userid, use finger -options userid@ this will search all your LAN hosts machines. Use finger -options @hostname to get a listing of all users on hostname



Finding Users with who

To find out about users, processes on your machine use who. who will display a list of users in this format:
root-tty03Aug 20 03:42
frankie+tty01Aug 20 10:22
matt+tty20Aug 20 19:03
ops-tty00Aug 20 00:00

As show the output will include the login name of the users, the tty, date and time. If you use who -T, before the tty a + or - will be displayed (as above), this indicates whether you can write to the terminal or not (a + means that you can write to the terminals and - you can't). The who -m will show you the equivalent of the who am i command, all the information you need about yourself.
Another useful option to who is -H which will put a header above each column of the output.

who for Remote Users

The who command can be used in the same way as you would use who, but will display information about remote users instead of local ones.
Use rwho hostname, to get a list of all users logged in at hostname. To get a listing as that which is produced by who, type rwho -l hostname. And a useful switch is -a which will produce a report on the specified machine even if no users are logged in.



Talking to Other Users

If you need to talk to another user use talk. First you will need to know at what machine the person you want to talk to is logged on (use finger, rusers, ... to find out).
Type talk userid@hostname where userid is the login name of the person you want to talk to and hostname is the machine where s/he is logged on (don't forget the @ sign!).
If the person you want to talk to is still logged in s/he will get a message that looks like:

Message from Talk_Daemon@darkstar at 16:00 ...
talk: connection requested by user@darkstar.
talk: respond with: talk user@darkstar

To respond you would type talk user@darkstar, your screen will then split in two. All you type will appear in the top half and what the person talking with you type will appear on the bottom part.
You will quickly notice that your screen becomes a mess, to clear it use Ctl & L. To quit from the talk connection use Ctl & C. This will terminate the talk session and return you to your shell.

Using Talk Across Networks

To use talk across networks you need to know the machine name as well as the hostname for the person whom you want to talk with. Best way to find that out is to ask them! Alternatively use finger.
type talk userid@machinename.hostname, for example you would use lauvj@crocus.warwick.ac.uk to get in touch with me. Notice how you put the user name followed by the @ sign, the name of the machine (crocus), and then the hostname (here warwick.ac.uk).



Using Write

To just write a message on another user's screen use write userid or optionally write userid ttynn, where nn is the tty number the user is using. After you typed in the command type in any text/messages you wish to send. then end it with a Ctl & C.
That person will then receive something like:

Message from yourid yourtty
The message you typed in.



Stopping Messages

Some times you just don't want other people disturbing your work, and having talk requests and messages popping up all over the place can be very disturbing.
To stop any messages use chmod -w /dev/tty or you can use mesg n. This will prevent you from being disturbed by the talk/write messages.
Note: These commands won't stop any messages from the superuser, the only way you can stop these is, not being logged on!


< Previous: The Internet ^ Next: Compression >
Index

Frankie Blaskovic
Last modified: Sun Aug 10 15:18:02 BST 1997