Windows to Ubuntu password free login
- First check if there is a. ssh folder under the C-Drive user folder, and check if there are at least two files in the folder, one is Xxx_rsa and Xxx_rsa.pub, one is the private key file and one is the public key file.
- If not, execute ssh-keygen-t rsa-c "you set the name or email address" to generate a new secret key, enter will prompt you to enter the password, direct enter, do not set the password, so in (1) The folder will have a public key and a private key file
- After the public and private key files are available, you need to upload the public key to a server that requires a password-free login, which requires two software, one that Cmder can support some Linux commands, and a Xshell to upload files.
- First open the Xshell, create a new one you need to password-free login server connection, in the landing when I encountered a problem, is clearly the correct password but unable to log on to the remote server
- This time we need to modify the configuration of the server-side ssh, first download the Start Remote Connection Service tool sudo apt-get install Openssh-server, after completing the restart under the SSH service sudo/etc/init.d/ssh restart
- Modify the/etc/ssh/sshd-config file, pubkeyauthentication Yes to no,passwordauthentication no modify to Yes, and then restart the service again. At this point, you can use Xshell to connect to the server via a password.
- Then under Xshell Press ctrl+alt+f new file transfer, this time will prompt you to enter the password (because we have changed the configuration file to login by password, if not changed will prompt you to add the public key), this is Xshell command line at the beginning of the word will have SFTP
- Use the command put local public key address remote server you want to place the public key address, this time to view the server, my public key will be in the home folder or the root folder
- Locate the public key file and drop it into the/root/.ssh folder if the. ssh folder does not exist and you can create it yourself
- Execute the Cat public key file name >> Authrized_keys, create a new Authrized_keys file and copy the contents of the public key file inside
- Then change the fourth step of the SSH configuration back, and then restart the next SSH service sudo/etc/init.d/ssh restart
At this point you can use the Ssh-i private key file path server username @ server address in Cmder to avoid a secret login.
Ps:linux and Mac do not need to be so troublesome, use ssh-copy-id-i public key filename User name @ server address, behind simple configuration can be, there are many tutorials on the internet do not repeat
Windows to Ubuntu password free login