在Debian/Ubuntu上使用apt安装OpenSSH:
sudo apt update sudo apt install openssh-client openssh-server
在Red Hat/CentOS上使用yum安装OpenSSH:
sudo yum install openssh-clients openssh-server
使用ssh-keygen生成密钥对
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" //-t rsa 指定密钥类型为 RSA。 //-b 4096 指定密钥长度为 4096 比特,提高安全性。 //-C "your_email@example.com" 添加注释,一般用你的邮箱地址。 //生成密钥对后,你可以选择将其存储在默认位置(~/.ssh/ 目录下)或选择其他位置。