Article Title: Security Strategy for SSH service connections. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
What is SSH?
The full name of SSH is Secure SHell. By using SSH, You can encrypt all transmitted data so that the "man-in-the-middle" attack method is impossible and can also prevent DNS and IP spoofing. Another advantage is that the data transmitted is compressed, which can speed up transmission. SSH has many functions. It can replace telnet and provide a secure "channel" for ftp, pop, and even ppp ". When the SSH client communicates with the server, the user name and password are encrypted to effectively prevent password eavesdropping. SSH was initially developed by a Finnish company. However, due to copyright and encryption algorithm restrictions, many people have switched to OpenSSH. OpenSSH is an alternative to SSH and is free of charge. It is expected that more and more people will use it instead of SSH in the future. SSH is composed of client and server software. SSH is easy to install, easy to use, and common. Generally, Unix, Linux, and FreeBSD systems all come with application packages that support SSH.
How does SSH security authentication work?
From the client perspective, SSH provides two levels of security authentication.
Level 1 (password-based security verification) you can log on to the remote host as long as you know your account and password. All transmitted data is encrypted, but it cannot be guaranteed that the server you are connecting to is the server you want to connect. Other servers may pretend to be real servers, that is, being attacked by man-in-the-middle.
The second level (key-based security verification) depends on the key, that is, you must create a pair of keys for yourself and put the public key on the server to be accessed. If you want to connect to the SSH server, the client software will send a request to the server, requesting your key for security verification. After receiving the request, the server first looks for your public key in the home directory of the server, and then compares it with the public key you sent. If the two keys are the same, the server uses the public key to encrypt the challenge and send it to the client software. After receiving the question, the client software can use your private key to decrypt it and then send it to the server.
In this way, you must know your key password. However, compared with the first level, the second level does not need to transmit passwords over the network.
The second level not only encrypts all transmitted data, but also the "man-in-the-middle" attack method is impossible (because he does not have your private key ). However, the entire logon process may take 10 seconds.
Command Format
First, make sure that the ssh service on the server is enabled (service shhd start)
Then enter ssh usrname @ serverip (Remote logon) on the client)
Scp filename usrname @ serverip:/URL (remote transmission)
Common problems:
Question 1
An error occurred while logging on to the ssh client.
Tip (1 ):
# Ssh 172.16.81.221
Ssh: connect to host 172.16.81.221 port 22: No route to host
This is because the server is not started or the network is disconnected (this is a lot of reason, the simplest is that the network cable is not plugged in. In addition, the NIC may be down)
Tip (2 ):
# Ssh work@172.16.81.221
Ssh: connect to host 172.16.81.221 port 22: Connection refused
This is because the ssh service of the other server is not enabled. This server enables the service.
[1] [2] Next page