Linux Common network commands (ii) _unix Linux

Source: Internet
Author: User
Tags file copy

Accessing a remote computer using the Telnet command
The user uses the Telnet command to log on remotely. This command allows users to use the Telnet protocol to communicate between remote computers, and users can log on to a remote computer over the network, as if they were logged on to the local machine to execute commands. In order to log on to a remote computer by Telnet, you must know the legal user name and password on the remote machine. Although some systems do provide logon capabilities for remote users, the ability to use them is limited for security reasons, so there are few features that can be used in this case. When remote users are allowed to log on, the system typically places these users in a restricted shell to prevent the system from being compromised by malicious or careless users. Users can also use Telnet to log on to their computers from remote sites, check e-mail, edit files, and run programs as if they were logged on locally.
However, users can only use a terminal-based environment rather than an X-wndows environment, and Telnet only provides terminal emulation for the common terminal, and does not support graphics environments such as X Wndow. The general form of the Telnet command is: telnet hostname/IP, where "hostname/IP" is the host name or address of the remote machine to which you want to connect. If this command succeeds, the login: prompt will be obtained from the remote machine. The procedure for logging in using the Telnet command is as follows: $ telnet host name/IP starts the telnet session. Once Telnet is successfully connected to the remote system, the login information is displayed and the user is prompted to lose the user name and password. If the username and password are entered correctly, you can log on successfully and work on the remote system. You can enter many commands after the Telnet prompt to control the Telnet session process, which is described in detail in the Telnet online Help manual.

The following is an example of a Telnet session on a Linux computer:
$ telnet Server. Somewhere. com trying 127.0.0.1 ... Connected to serve. Somewhere. com. Escape character is \ '?] \'. "Turbolinux Release 4. 0 (Colgate) kernel 2.0.18 on a I486 login:bubba password:last Login:mon Nov L5 for 20:50:43 Linux 2. 0.6. (Posix). Server: ~$ server: ~$ logout Connection closed by foreign host $

After the user finishes the remote session, be sure to use the logout command to exit the remote system. Telnet then reports that the remote session was closed and returned to the user's local machine's shell prompt. R-Series commands can also use the R-Series command to access remote computers and Exchange files on the network, in addition to FTP and Telnet. Using the R-Series commands requires special attention, because if the user is not careful, it can cause serious security vulnerabilities. After the user issues a R-series command, the remote system checks the file named/etc/hosts.equiv to see if the user's host is listed in this file. If it does not find the user's host, check the home directory of the user with the same name on the remote machine named. Rhosts the file to see if the user's host is included. If the user's host is included in any of these two files, the user does not have to provide a password to execute the R-series command.

Although it may be convenient for a user to not type a password each time they access a remote machine, it can also cause serious security problems. We recommend that users carefully consider the security implications of the R-command before establishing/ETC/HOSTS.EQUIV and. rhosts files.

Rlogin command
Rlogin is the abbreviation for remote login (remote login). This command is similar to the Telnet command, allowing the user to initiate an interactive command session on a remote system. The general format of the rlogin is:
rlogin [ -8EKLDX] [-e char] [-K realm] [-l username] Host

The most commonly used format is: Rlogin host the options in this command have the meanings:
-8 This option always allows 8-bit input data channels. This option allows you to send formatted ANSI characters and other special code. If you do not use this option, the parity bit is removed unless the end and start characters are not OR.
-e stops treating any character as an escape character. When used with the-8 option, it provides a fully transparent connection.
-K closes all Kerberos confirmations. This option is only used if you are connected to a host that uses the Kerberos acknowledgement protocol.
-L allows the rlogin session to run in Litout mode. For more information, see the TTY online Help.
-D open socket debugging for TCP sockets that communicates with the remote host. For more information, consult the setsockopt online Help.
-E Sets the escape character for the rlogin session, the default escape character is "~", and the user can specify a literal character or a \\nnn form of octal number.
-K requests Rlogin to obtain the Kerberos license of the remote host within the specified zone, instead of obtaining the Kerberos license of the remote host within the remote host zone determined by Krb_realmofhost (3).
-X opens DES encryption for all data transmitted through the Rlogin session. This affects response time and CPU utilization, but can improve security.

RSH command
RSH is the abbreviation for remote shell. This command launches a shell on the specified remote host and executes the command specified by the user on the rsh command line. If the user does not give a command to execute, RSH uses the rlogin command to log the user on to the remote machine.
The general format of the RSH command is:
RSH [-kdnx] [-K realm] [-l username] host [command]
The usual format is:
RSH host [command]
command can be any Linux command that is a key person from the shell prompt.
The options in the RSH command have the following meanings:
-K closes all Kerbero confirmations. This option is only used when connecting with a host that is confirmed with Kerbero.
-D open socket debugging for TCP sockets that communicates with the remote host. For more information, consult the setsockopt online Help.
-K requests Rsh to obtain the Kerberos license of the remote host within the specified zone, instead of obtaining the Kerberos license of the remote host within the remote host zone determined by Krb_relmofhost (3).
-L By default, the remote user name is the same as the local user name. This option allows you to specify a remote user name and, if a remote username is specified, use Kerberos acknowledgement, as in the Rlogin command.
-n redirects input from special device/dev/null.
-X opens DES encryption for all data that is transferred. This affects response time and CPU utilization, but can improve security. Linux puts the standard input into the RSH command and copies it to the standard input of the command to be executed remotely. It copies the standard output of the remote command to the standard output of the rsh. It also copies the remote standard error to the local standard error file. Any exit, abort, and interrupt signals are sent to the remote command. When the remote command is terminated, the rsh is terminated.

rcp command
RCP represents "Remote file copy". This command is used to copy files between computers.
The RCP command has two formats. The first format is used to copy files to files, and the second format is used to copy files or directories to another directory.
The general format of the RCP command is:
rcp [-px] [k realm] File1 file2 rcp [-px] [-R] [-K Realm] File
Directory each file or directory parameter can be either a remote file name or a local file name. The remote file name has the following form: Rname@rhost:path, where rname is the remote user name, Rhost is the remote computer name, and path is the pathname of the file.
The options for the RCP command have the following meanings:
-R recursively copies all content in the source directory to the destination directory. To use this option, the purpose must be a directory.
-P attempts to preserve the modification time and mode of the source file, ignoring umask.
-K requests RCP to obtain the Kerberos license of a remote host within a specified zone, rather than obtaining the Kerberos license of a remote host within the remote host zone determined by Krb_relmofhost (3).
-X opens DES encryption for all data that is transferred. This affects response time and CPU utilization, but can improve security. If the path specified in the filename is not a full pathname, the path is interpreted as the home directory of the user with the same name on the remote machine. If the remote user name is not given, the current username is used. If the path on the remote machine contains special shell characters, it needs to be surrounded by backslashes (\), double quotes ("), or single quotes (') so that all shell metacharacters can be interpreted remotely. It is important to note that RCP does not prompt for a password, and it performs a copy through the RSH command. (Source: Network)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.