-->
Previous Table of Contents Next


Here, an FTP session is initiated with ftp.uu.net, which is a major FTP archive site on the Internet. The username given at the login prompt is anonymous because this is anonymous FTP. For the password, the full e-mail address is used. ftp.uu.net then displays a welcome banner that gives some information about the archive. In this example, you can see that the user changes directories, sets the file mode to binary, gets a compressed binary file, and exits.


TROUBLESHOOTING:  
I transferred a binary file, but it doesn’t work properly. I can’t unzip it, untar it, uncompress it, or anything. What should I do? Make sure that you set the transfer mode to binary. You can do this with the binary command at the ftp> prompt.

I’m in the process of transferring a large file and want to check the progress. Use the hash command. ftp prints the # character on-screen after every data buffer that’s processed. The data buffer may vary depending on your version of Linux, but it’s typically 1,024, 4,096, or 8,192 bytes.

I was trying to do an anonymous FTP, but the site told me that the user anonymous was unknown and that the login failed. Either you misspelled “anonymous,” or the site doesn’t allow anonymous FTP. In the latter case, you must have a valid username and password on the remote computer.

I want to transfer several files, but I don’t want FTP to prompt me for each one. Use the prompt command, which toggles prompting on and off.

I tried to use anonymous FTP, but the site told me that I didn’t enter a valid e-mail address as the password. In the past, the convention during an anonymous FTP connection was to enter guest as the password. Now, the convention is to enter your e-mail address. Many FTP sites run special FTP server software that checks the password and makes sure that it’s in the form use@host.somewhere.domain. Try again and make sure that you enter your full e-mail address correctly.


Using the r- Commands

In addition to ftp and telnet, several other commands allow you to access remote computers and exchange files over a network. These commands are known collectively as the r- commands.

The r- commands deserve special notice because one of their features can cause a severe security loophole if you aren’t careful. When you issue an r- command, the remote system checks a file named /etc/hosts.equiv to see whether your local host is listed. If it doesn’t find your local host, it checks for a file named .rhosts in your home directory on the remote machine. The r- command then checks to see whether your local host name is in the .rhosts file. If your local host is listed in either place, the command is executed without checking for a password.

Although it can be very convenient not to type your password every time you need to access a remote computer, it can obviously cause severe security problems. It’s recommended that you carefully consider the security implications of the r- commands before setting up /etc/hosts.equiv and .rhosts files on your local system.

rlogin

The rlogin command is very similar to the telnet command because it allows you to start an interactive command session on a remote system. The syntax of rlogin is as follows:


rlogin [-8EKLdx] [-e char] [-k realm] [-l user-name] hostname

However, the most common usage is simply this:


rlogin hostname

Table 30.3 explains the various options for rlogin.

Table 30.3 Command-Line Options for the rlogin Command

Option Description

-8 Allows an 8-bit input data path at all times, which allows for formatted ANSI characters and other special codes to be sent. If this option isn’t used, parity bits are stripped except when the remote stop and start characters are other than <Ctrl-s> and <Ctrl-q>.
-E Stops any character from being recognized as an escape character. When used with the -8 option, this provides a completely transparent connection.
-K Turns off all Kerberos authentication. It’s used only when connecting to a host that uses the Kerberos authentication protocol.
-L Allows the rlogin session to be run in litout mode. Refer to the tty man page for more information.
-d Turns on socket debugging on the TCP sockets used for communication with the remote host. Refer to the setsockopt man page for more information.
-e Used to set the escape character for the rlogin session. The escape character is ~ by default. You can specify a literal character or an octal value in the form \nnn.
-k Requests rlogin to obtain Kerberos tickets for the remote host in the specified realm instead of the remote host’s realm as determined by krb_realmofhost(3).
-l Allows the remote name to be specified. If available, Kerberos authentication is used.
-x Turns on DES encryption for all data passed via the rlogin session. This can affect response time and CPU usage, but provides increased security.


Previous Table of Contents Next