【Ubuntu/Linux】Set up Ubuntu18.04 SSH without login
Enterprise
2023-09-09 21:55:55
views: null
Step 1: The host generates public and private keys
- Open cmd as administrator
- Run "ssh-keygen -t rsa"
- There is no need to enter anything and just press Enter. If you encounter a choice, just select Y.
- As shown in the figure below, the generation is successful and the secret key path is under "C:\Users\username.ssh"
Step 2: Copy the "id_rsa.pub" file to the .ssh folder of the Linux login user, usually "home/username/.ssh"
Step 3: Execute "cat id_rsa.pub > authorized_keys" in the user.ssh directory of the remote terminal.
Note, if a key pair already exists locally, go to the remote folder to edit authorized_keys and add your own public key at the end.
Origin blog.csdn.net/qq_42071369/article/details/129709745