SSH Connection Configuration
SSH Key Generate
Configure ssh for password-free quick connection. First check the ~/.ssh/ folder on the local.
If you have not generated
id_rsarelated files before, you can generate ssh keys throughssh-keygen -t rsa -b 4096 -C "[email protected]". Among them,-t rsaspecifies the use of thersaencryption algorithm,-b 4096specifies the number of bits of the key, and-C "[email protected]"adds a note to your own email address (the note can also be other).If you are not a Windows user, you can directly use
ssh-copy-id user@serverto copy. If you are a Windows user, open theid_rsa.pubfile in the~/.ssh/directory and copy the contents. Enter the server's~/.ssh/authorized_keysfile and add the contents you just copied.
(Optional) Configure SSH Client
If you want to simplify long command line instructions, for example use ssh server instead of ssh user@hostname, you can configure SSH client settings through the ~/.ssh/config file to simplify the connection command. The example is as follows:
Host server
HostName hostname
User user