The first step to harden a Linux machine is to enable passwordless logins and disable password-based authentication.
However, the passwordless login requires a pair of public/private SSH keys, and the public key should be copied to the server and stored in a file named authorized_keys located in the .ssh folder inside user's home directory.
One simple way to do that is to use a command called ssh-copy-id, but this command is not available on Windows and Mac machines.
In this repository, you'll find a Python implementation of ssh-copy-id command for all platforms.
The above is the detailed content of ssh-copy-id command on any machine. For more information, please follow other related articles on the PHP Chinese website!