Basic Networking Utilities
Understanding the functions and uses of networking utilities
telnet <machine_name>
The telnet utility is an insecure mechanism for logging into remote machines. All data sent via telnet, including the username and password, is passed in unencrypted format over the network. The rlogin and rsh utilities used for logging into remote machines and for executing commands on remote machines also send unencrypted data across the net. Telnet login access is disabled on most systems and secure alternatives like ssh are used. However, telnet may still be used to connect to other services to obtain web pages, e-mail, news and so on. Some systems allow telnet to connect to other local area network systems.
ssh <machine_name>
ssh sends all information in encrypted form and is the best utility to use for remote login and command execution. It is also GUI capable; X11 connections (i.e. graphics) can also be forwarded over ssh. SSH can be downloaded from this site and installed if not already available with your distribution.
ping <machine_name>
The ping utility is useful for checking response time between machines and to see if the machine that corresponds to an ip address or hostname is alive or up. The following command measures the time taken for the current machine and google.com to establish a connection and exchange short messages.
[ LinuxUser ] ~$ ping www.google.com
traceroute <machine_name>
The above command shows the path taken to reach a remote machine, that is, the 'hops' the data makes from one machine (or router) to another over the network until it finally 'hops' to the destination. The output includes the delay to each machine along the route. The output is used to trouble shoot network problems.
ftp <machine_name>
The ftp utility allows file transfer between computers. Once the user logs in, he may use 'dir' to list out the contents of a directory, 'cd' to change directory, 'get' to receive files, and 'put' to send files to the machine. The 'bin' command should be issued before transferring anything other than text files. The 'quit' command closes the ftp dialogue. ftp hosts often allow users to login without accounts via the accounts 'guest' or 'anonymous' with no password. The ftp utility is insecure; it does not encrypt information. However, ftp is widely used to download free material, tutorials, and other useful documents.
scp <source_files> <destination>
The scp utility is a secure way alternative to ftp. scp works almost exactly like the 'cp ' command. However the arguments specify a user and machine as well as files.
[ LinuxUser ] ~$ scp someone@somedomain.con:~/mail.txt .
The above command copies the mail.txt file from the home directory of user 'someone' at the host 'somedomain.com' onto a file of the same name in the current directory (.) of the local machine.
The who utility displays the list of users logged into a machine, the terminal each user is using, and the sign-in date and time. The finger utility has the syntax 'finger username' and may be used to get information on a single user. Some users customize their profiles so that other users can get a lot of personal information about them via finger.
[ LinuxUser ] ~$ who LinuxUser tty0 Nov 27 19:41 [ LinuxUser ] ~$
The write utility sends line-by-line messages to other users on the same system. It is used by users on the same machine who want to talk to each other. The username and the terminal may be specified (the terminal is optional)
[ LinuxUser ] ~$ write LinuxUser tty0
Hi there!
The talk utility is a chat-like program that may be used between remote machines. It opens up a two-way dialogue.
[ LinuxUser ] ~$ talk someone@somedomain.com
Mail is the standard Linux E-mail utility. The command 'mail' enables a user to enter into the mailbox. Commands may be issued at the & prompt within the mail dialogue to compose mail, check mail, and send mail. The composer is configured to a text editor like vi or emacs. The user may customize mail settings using the appropriate configuration files.
[ LinuxUser ] ~$ mail
Mail version 8.11.3 3/2001. Type ? for help.
"/var/spool/mail/LinuxUser": 2 messages 2 new
1 molly@dolly.com Sun Nov 26 10:37 "Good Golly!"
2 fred@dread.com Sun Nov 26 21:50 "Hi There"
&
Sendmail - Brief Reference
| Command | Description |
| ? | help |
| q | quit, saving changes to mailbox |
| x | quit, restoring mailbox to its original state |
| t messagelist | display messages |
| +/- | show next/previous message |
| d messagelist | delete messages |
| u messagelist | restore deleted messages |
| m address | send a new e-mail |
An E-mail may be sent to another user directly from the command line by writing the message into a file and then sending the file as input to the mail command:
[ LinuxUser ] ~$ mail -s "Hi" someone@somedomain.com < myMsg.txt
Most users prefer the user friendly mutt, elm or pine e-mail interfaces to mail. These come with excellent inline documentation. Emails are actually sent using an Email Transfer Agent that in turn utilizes the Simple Mail Transfer Protocol (SMTP). The two most popular Email Transfer Agents are sendmail and exim. The exim and sendmail agents include extensive header information about origin IP address and domain when they forward e-mail. The utilities described in this chapter are just a sample of Linux network capabilities.