jiakuanghe.github.io

How To Use SSH To Login

ssh username@server

Example

ssh root@10.1.0.101

image-20230403152910503

If we press no, the ssh will disconnect.

image-20230403152942586

For safety reason, any input here will not be shown.

image-20230403153053280

image-20230403153138847

Permission denied, please try again.

If the password is wrong, you will get the tips Permission denied, please try again.

image-20230403153710964

Passwordless login

1. Create a ssh key

   ssh-keygen

Press down enter to save the default directory

image-20230403154422100

image-20230403154511669

2. ssh-copy-id

ssh-copy-id username@server_ip

image-20230403154951437

How they work

Server 10.1.0.101

image-20230403155406274

Connected Server 10.1.0.102

image-20230403155436210

Untitled Diagram.drawio

RSA

RSA (Rivest–Shamir–Adleman) is a public-key cryptosystem that is widely used for secure data transmission.

RSA (cryptosystem) - Wikipedia

public key and private key

In a public-key cryptosystem, the encryption key is public and distinct from the decryption key, which is kept secret (private).

public key: send to others, can be public

private key: secret key, we need to make it safe