Environment introduction
server function | name of server | server hostname |
---|---|---|
Actively initiate remote connection | Server A | serve |
connected server | Server B | serverb |
Configuration instructions
- Generate a key pair on server A
ssh-keygen -t rsa
At this point, the key pair will be generated in the ~/.ssh directory on server A
- Copy the key pair to the specified server B, and log in as the specified user
ssh-copy-id user@serverb
configuration effect
- Directly use ssh@serverb to remotely, no need to enter a password