The TCP/IP network communication software package uses remote access commands. These commands were first developed for Arpanet by UC Berkely. It allows you to remotely register to another system and copy files from one system to another. You can obtain information about a system, such as who is currently registering for use. When calling a system address, these remote commands use the domain name or IP address. Like the TCP/IP Remote Access command, the domain name address is designed for use on Arpanet.
Many TCP/IP commands can be compared with the network communication functions used on the Internet. For example, you can remotely register a system using the TCP/IP command rlogin, which is similar to telnet. The rcp command can remotely copy files and execute the same functions as ftp. The difference between TCP/IP commands is that they provide users with ease of use and control. You can easily access accounts in different Unix or Linux systems and control users who access these accounts but do not provide passwords. In fact, you can provide different users with a set of permissions about your account.
I. TCP/IP network system information: rwho, uptime, and ping
These commands are some TCP/IP commands, through which you can obtain information from different systems in the network. You can find out who is registering, get information about users in another system, or query whether a system is running. For example, the rwho command and the who command have similar functions. It displays the currently registered users of each system in the network.
$ Rwho
Violet robert: tty1 Sept 10
Garnet chris: tty2 Sept 10
The command ruptime can display the information of each system in the network. This information shows how each system is executed. Ruptime indicates whether the system is running, how long it is running, the number of users in the system and the system load in the last 5, 10, and 15 minutes.
$ Ruptime
Violet up 11 + 04: 10, 8 users, load 1.20 1.10
Garnet up 11 + 04: 10, 20 users, load 1.50 1.30
Command ping can detect whether the system is started and running. The ping Command is added with the system name you want to detect as a parameter. The following example checks whether viletting is started and connected to the network.
$ Ping violet
Violet is alive
$
If the system you want to detect has been shut down, you will receive the following response. In this case, garnet is disabled and is not connected to the network.
$ Ping garnet
No answer from garnet
$
Ii. Remote Access permission:. rhosts
You can use the. rhosts file to control access to your account using the TCP/IP command. Users can use the standard editor like Vi to create the. rhosts file in their account. It must be in the user's home directory. In the following example, the user displays the content of the file. rhosts.
$ Cat. rhosts
Garnet chris
Ciolet robert
Using the. rhosts file is a simple way to allow users to access your system without providing a password. To prohibit access from this user, you must simply delete the system and user registration names from the file. rhost. If a user's Registration Name and system name are in the file. rhost, the user can directly access the system without providing a password. Not all remote registration operations require this access mode (you can enter a password to replace it). However, some remote commands require that. rhosts file, such as remote file copy or remote execution of Linux commands. If you want to entertain these commands in a remote system account, the. rhosts file of this account must contain your registration name and system name.
When using. rhosts to access a system, you can also use TCP/IP commands to directly access other accounts in the system. You do not need to register with these accounts first. You can use another account in the system as an extension of the current registered account. You can use the frcp command to copy files from one directory to another regardless of the account under which the file card is located. Run the rsh command to entertain any Linux commands in other accounts.
Iii. Remote Registration: rlogin
You may have your own account on different systems on the network, or you can access another account on another system. To access an account in another system, first register it in your system, and then remotely register it in the system where the account is located through the network. You can remotely register a system with the rlogin command. The command parameter must be a system name. The command will connect you to another system and start the registration process.
The rlogin registration process is different from the general registration process. When rlogin is used, the user is not prompted to enter the registration name. Rlogin assumes that the registration name in your local system is the same as that in the remote system. So when you execute the rlogin command above, you will be prompted to enter the password immediately. After entering the password, you can access the accounts of the remote system.
Use rlogin to assume that registration is the same, because most people use rlogin to access the registration name in other systems, which is generally the same as the local registration name. However, when the registration name in the remote system is different from that in the local system, option 1-allows you to enter different registration names for the remote system account. The syntax is as follows:
$ Rlogin sys tem-name-1 login-name
In the following example, the user uses the registration name robert to register with the viotay system.
$ Rlogin violet-1 robert
Password
$
: Once registered to a remote system, you can execute any command. You can use exit, CTRL-d, or logout (TCSH or C-shell) to end the connection.
4. Remote File Replication: rcp
You can use the rcp command to copy files from a remote system to a local system. Rcp executes the file transfer function. Its operations are similar to those of the cp command, but it connects to another system through the network. The remote system is required to execute the command rcp. The rhosts file contains your local system name and registration. The command rcp starts with the keyword rcp. The parameter is the source file name and the copied target file name. To specify a file in a remote system, You must place a system name before the file name. The two names are separated by colons, as shown below:
$ Rcp sys tem-name: source-file slystem-name: copy-file
When copying a file to a remote system, the target file to be copied is a remote file, which requires a system name. The source file does not require the system name in your local system:
$ Rcp source-file remote-sys tem-name: copy-file
In the following example, you copy the weather file from your system to the remote system, and rename it Monday.
$ Rcp weather violet: Monday
When copying a file from a remote system to a local machine, the source file is a remote file, which requires a system name. The copied target file is in your local system and does not require the system name:
$ Rcp remote-sys tem-name: source-file copy-file
In the following example, you can copy the entire directory from a remote system. Adding the-r option to the rcp command will copy one directory and Its subdirectories from one system to another. Like the cp command, rcp requires a source directory and a copy directory. A directory in a remote system requires the system name and a colon separated by the system name and directory name, as well as the directory name. When you copy a directory from your system to a remote system, you need a remote system name to copy the directory from the remote system.
$ Rcp-r source-directory remote-sys tem-name: copy-directory
In the following example, the user copies the letters directory to the oldnotes directory in the remote system viotlet.
$ Rcp-r letters violet: oldnotes
When you copy a directory from a remote system to a local machine, the source directory in the remote system requires the remote system name.
$ Rcp-r remote-sys tem-name: source-directory copy-directory
In the following example, the user copies the birthdays directory in the remote system violet to the local directory party.
$ Rcp-r violet: birthdays party
At the same time, you can use an asterisk to specify a name or use a dot to reference the current directory. Special Shell characters are interpreted and converted by your local system, rather than remote systems. To enable remote system interpretation to convert a specific character, you must reference it in some way. To copy all files with the extension. c to your system, you need to use the special character-asterisk: *. c to specify all files with the extension. c. You must note the asterisk reference method. In the following example, a file with the. c extension in the system viotlet is copied to the user's system. Note that the asterisk is referenced by a backslash. The last dot indicates that the current directory is not referenced. It is interpreted and converted by your local system.
$ Rcp violet: *. c
In the following example, the directory report is copied from the user's local system to the current directory of the remote system. Note that the dot is referenced and will be interpreted and converted by the remote system.
$ Rcp-r reports violet :.
5. Remote Execution: rsh
You may need to execute a command in the remote system. The rsh command will execute a command on a remote Linux system and display the result to your system. Of course, your system name and registration name must be in the. rhosts file of the remote system. The command rsh has two common parameters, one system name and one Linux Command. The syntax is as follows:
$ Rsh remote-sytem-neame Linux-command
In the following example, The rsh command will execute an ls command in the remote system violet to list the files in the/home/robert directory in the violet.
$ Rsh violet ls/home/robert
Unless it is a reference to a specific character, it will be interpreted and converted by the Lee system, especially for special characters that control the standard output, such as redirection or pipeline characters. The following example lists the files on the remote system and sends them to the standard output in the system. The redirection operation is explained by the local system and the output is directed to the myfiles file in the local system.
$ Rsh violet ls/home/robert> myfiles
If you reference a specific character, it will be interpreted as part of the Linux Command by the remote system. Referencing the redirection operator will allow you to perform the redirection operation in a remote system. In the following example, A redirection operator is referenced. It becomes part of a Linux Command, including the command parameters and file name myfile. The command ls generates a column of file names and redirects them to a file myfile in the remote system.
$ Rsh violet ls/home/robert> myfiles
This is also true for MPs queue operations. In the following example, the First Command outputs a column of files to the local printer. The standard output can be output to your online printer in a pipeline. In the second command, a column of files will be output to the printer of the remote system. The MPs queue is interpreted by the remote system. Deliver the standard output to the printer of the remote system. -Name: source-file copy-file
In the following example, you can copy the entire directory from a remote system. Adding the-r option to the rcp command will copy one directory and Its subdirectories from one system to another. Like the cp command, rcp requires a source directory and a copy directory. A directory in a remote system requires the system name and a colon separated by the system name and directory name, as well as the directory name. When you copy a directory from your system to a remote system, you need a remote system name to copy the directory from the remote system.
$ Rcp-r source-directory remote-sys tem-name: copy-directory
In the following example, the user copies the letters directory to the oldnotes directory in the remote system viotlet.