Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Login Mechanism of ssh based on Secret key

2025-04-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The default port for ssh connection is tcp22 port

Generally speaking, the login method based on user name and password is not secure enough, because the user name and password are easy to leak, so there is this kind of login method based on secret key.

Based on secret key login process

(1) ssh client first generates a pair of its own private key and public key and sends its own public key to ssh server

(2) ssh server generates a random number, encrypts the random number with ssh client's public key, and then sends it to ssh client

(3) after receiving the encrypted random number, ssh client decrypts it with its own, and then sends the number to ssh server

(4) ssh server compares this number, establishes a ssh connection if it is the same, and stores the public key in the authorized_keys file in the .ssh directory of the home directory.

Generate ssh client secret key

Ssh-keygen (this process can encrypt the private key)

Send ssh client public key to ssh server

Ssh-copy-id hostip

Authorized_keys will be stored in the .ssh directory in the ssh server home directory, with the same information as the client's public key file.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report