Featured image of post Windows configuration is free to entertain Ubuntu without taking effect

Windows configuration is free to entertain Ubuntu without taking effect

This article introduces and solves the problem that the Windows configuration is free to enter Ubuntu. Ubuntu does not take effect

Warning: This page is translated by MACHINE, which may lead to POOR QUALITY or INCORRECT INFORMATION, please read with CAUTION!

Windows configuration is free to entertain Ubuntu without taking effect

cause

During the configuration of my personal blog, I planned to use GitHub Action to automatically deploy, which needs to be used to use the SSH key to set aside.

  1. How to configure the SSH key to log in at Ubuntu 20.04

  2. Solution does not take effect after the success of SSH -free login configuration

Configuration

The blogger uses win10, ubuntu20.04;

The process of configuration key is very simple. First of all

1
ssh-keygen -t rsa -q -C "For SSH" -f rsa_id

Then usessh-copy-id remote_username@server_ip_address Deploy the public key to the remote server, but Windows generally does notssh-copy-idOrder, so you can use the following command instead.

1
cat ~/.ssh/id_rsa.pub | ssh remote_username@server_ip_address "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

After that, restart the SSH service and use itssh remote_username@server_ip_address The connection found that the password is still required. After checking the information, the link 2 is on the Linux platform. It is not applicable to Windows. It is puzzled.

Solution

I found that the OpenSSH AUTHENTICATION AGENT item is not started. The description is very clear. It is used to verify the public and private key. After the service is turned on, it is still impossible to connect directly.

image-20230413152155447

Finally, add config files in your .ssh directory

1
2
3
4
5
Host yourhost
     Hostname yourhost
     Port 22
     User youruser
     IdentityFile ~/.ssh/your_key

Re -connect after saving and solve it perfectly! image-20230413152155447