BKJIA exclusive Article] Linux provides a variety of ways for users to remotely manage, such as Telnet. Its basic application is to provide remote management and share resources in the remote system. Telnet enables the user to sit in front of his computer and access another computer through the network, and each character entered by the user is transmitted to the host. Then, each information output by the host is displayed on the screen. Such a connection may occur in the same room or at both ends of the earth. However, the Telnet service is inherently insecure because it uses plain text to transmit data throughout the entire Telnet communication process. In today's network environment, such an operation is tantamount to suicide if it is found on the Internet.
SSH (Secure Shell) is different. It is a safer solution for remotely operating servers through online services. It was initially developed by a Finnish company, but due to copyright issues, currently, most of them are replaced by OpenSSH. It can encrypt all transmitted data so that the man-in-the-middle function is unlikely to succeed. In addition, SSH compresses data during data transmission, which can speed up data transmission. In short, SSH is very good and powerful, and is gradually replacing Telnet, becoming the main choice for remote login.
SSH works in the same way as Telnet Client/Server. Currently, there are two major incompatible versions: 1.x and 2.x. OpenSSH 2.x supports both 1.x and 2.x.
The following uses RHEL 5 as an example to describe the application of the SSH service in remote Logon:
By default, SSH has been installed and enabled in RHEL 5, but it is recommended to check whether the process and port work properly before use.
During the experiment, the user will remotely log on to golf. example. zqin through SSH on football. example. zqin. Before describing the configuration process, we will first introduce several common commands used in SSH:
Ssh [user @] hostname [command]
Remotely connect to the specified server
◆[User @]: the user name of the remote computer. If this parameter is left blank, the root user is used for connection.
◆[Command]: The command directly executed after the connection is successful
Scp [user @] host:/path [-rpC]
File copying between the ssh client and the server
◆-R: Recursion
◆-P: retain original File Permissions
◆-C: compressed data during transmission
Rsync srcfile host:/path
To synchronize files between the client and the server, this command is one-time. If you need to regularly execute the command, use crontab. In synchronization, it is only from srcfile TO host:/path.
1. Remote logon through SSH
1: use an ssh command to connect to a remote computer. If the user name is not entered, root is used by default.
2: If it is the first time you connect to a remote computer, because OpenSSH does not know the computer, a warning is displayed, indicating that yes is entered here. OpenSSH will add the recognition mark of this computer ~ In the/. ssh/know_hosts file, the second connection will not receive a warning.
3: Enter the root user password of the remote computer.
4: You have successfully connected to the remote computer. All the commands entered will be executed on the remote computer. You can exit by using the exit command.
I do not know whether there is a Bug in OpenSSH or other reasons. Sometimes everything is configured normally but cannot be connected to a remote computer. In this case, you can ~ /. Delete the content in ssh and try again.