📄 588-590.html
字号:
<HTML>
<HEAD>
<TITLE>Special Edition Using Linux, Fourth Edition:Accessing the Network with telnet, ftp, and the r-Commands</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0789717468//-->
<!--TITLE=Special Edition Using Linux, Fourth Edition//-->
<!--AUTHOR=Jack Tackett//-->
<!--AUTHOR=Jr.//-->
<!--AUTHOR=Steve Burnett//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=30//-->
<!--PAGES=588-590//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="585-588.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="590-592.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Here, an FTP session is initiated with <B>ftp.uu.net</B>, which is a major FTP archive site on the Internet. The username given at the login prompt is <TT>anonymous</TT> because this is anonymous FTP. For the password, the full e-mail address is used. <B>ftp.uu.net</B> 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.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>TROUBLESHOOTING: </B><BR><B>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?</B> Make sure that you set the transfer mode to binary. You can do this with the <TT>binary</TT> command at the ftp> prompt.
<P><B>I’m in the process of transferring a large file and want to check the progress.</B> Use the <TT>hash</TT> command. <TT>ftp</TT> 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.</P>
<P><B>I was trying to do an anonymous FTP, but the site told me that the user <TT>anonymous</TT> was unknown and that the login failed.</B> 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.</P>
<P><B>I want to transfer several files, but I don’t want FTP to prompt me for each one.</B> Use the <TT>prompt</TT> command, which toggles prompting on and off.</P>
<P><B>I tried to use anonymous FTP, but the site told me that I didn’t enter a valid e-mail address as the password.</B> In the past, the convention during an anonymous FTP connection was to enter <B>guest</B> 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 <TT>use@host.somewhere.domain.</TT> Try again and make sure that you enter your full e-mail address correctly.<HR></FONT>
</BLOCKQUOTE>
</P>
<H3><A NAME="Heading10"></A><FONT COLOR="#000077">Using the <I>r-</I> Commands
</FONT></H3>
<P>In addition to <TT>ftp</TT> and <TT>telnet</TT>, several other commands allow you to access remote computers and exchange files over a network. These commands are known collectively as the <TT>r-</TT> commands.</P>
<P>The <TT>r-</TT> commands deserve special notice because one of their features can cause a severe security loophole if you aren’t careful. When you issue an <TT>r-</TT> 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 <TT>r-</TT> 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.</P>
<P>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 <TT>r-</TT> commands before setting up /etc/hosts.equiv and .rhosts files on your local system.</P>
<H4 ALIGN="LEFT"><A NAME="Heading11"></A><FONT COLOR="#000077"><I>rlogin</I>
</FONT></H4>
<P>The <TT>rlogin</TT> command is very similar to the <TT>telnet</TT> command because it allows you to start an interactive command session on a remote system. The syntax of <TT>rlogin</TT> is as follows:</P>
<!-- CODE SNIP //-->
<PRE>
rlogin [-8EKLdx] [-e <I>char</I>] [-k <I>realm</I>] [-l <I>user-name</I>] <I>hostname</I>
</PRE>
<!-- END CODE SNIP //-->
<P>However, the most common usage is simply this:
</P>
<!-- CODE SNIP //-->
<PRE>
rlogin <I>hostname</I>
</PRE>
<!-- END CODE SNIP //-->
<P>Table 30.3 explains the various options for <TT>rlogin</TT>.</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 30.3</B> Command-Line Options for the <TT>rlogin</TT> Command
<TR>
<TH COLSPAN="2"><HR>
<TR>
<TH WIDTH="20%" ALIGN="LEFT">Option
<TH WIDTH="80%" ALIGN="LEFT">Description
<TR>
<TH COLSPAN="2"><HR>
<TR>
<TD VALIGN="TOP"><TT>-8</TT>
<TD>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>.
<TR>
<TD VALIGN="TOP"><TT>-E</TT>
<TD>Stops any character from being recognized as an escape character. When used with the <TT>-8</TT> option, this provides a completely transparent connection.
<TR>
<TD VALIGN="TOP"><TT>-K</TT>
<TD>Turns off all Kerberos authentication. It’s used only when connecting to a host that uses the Kerberos authentication protocol.
<TR>
<TD VALIGN="TOP"><TT>-L</TT>
<TD>Allows the <TT>rlogin</TT> session to be run in <TT>litout</TT> mode. Refer to the <TT>tty</TT> man page for more information.
<TR>
<TD VALIGN="TOP"><TT>-d</TT>
<TD>Turns on socket debugging on the TCP sockets used for communication with the remote host. Refer to the <TT>setsockopt</TT> man page for more information.
<TR>
<TD VALIGN="TOP"><TT>-e</TT>
<TD>Used to set the escape character for the <TT>rlogin</TT> session. The escape character is ~ by default. You can specify a literal character or an octal value in the form <TT>\nnn</TT>.
<TR>
<TD VALIGN="TOP"><TT>-k</TT>
<TD>Requests <TT>rlogin</TT> to obtain Kerberos tickets for the remote host in the specified realm instead of the remote host’s realm as determined by <TT>krb_realmofhost(3)</TT>.
<TR>
<TD VALIGN="TOP"><TT>-l</TT>
<TD>Allows the remote name to be specified. If available, Kerberos authentication is used.
<TR>
<TD VALIGN="TOP"><TT>-x</TT>
<TD>Turns on DES encryption for all data passed via the <TT>rlogin</TT> session. This can affect response time and CPU usage, but provides increased security.
<TR>
<TD COLSPAN="2"><HR>
</TABLE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="585-588.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="590-592.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -