1. 在我自己的PC机上生成 output_keyfile, output_keyfile.pub:
cc@PC:~/.ssh$ ssh-keygen -t rsa -P ''
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cc/.ssh/id_rsa): ali (名字随便起)
Your identification has been saved in ali.
Your public key has been saved in ali.pub.
The key fingerprint is:
a9:36:a3:17:5c:ef:4b:0e:45:05:24:a5:9e:3c:69:0d cc@PC
The key's randomart image is:
+--[ RSA 2048]----+
| . |
|
Generating public/private rsa key pair.
Enter file in which to save the key (/home/cc/.ssh/id_rsa): ali (名字随便起)
Your identification has been saved in ali.
Your public key has been saved in ali.pub.
The key fingerprint is:
a9:36:a3:17:5c:ef:4b:0e:45:05:24:a5:9e:3c:69:0d cc@PC
The key's randomart image is:
+--[ RSA 2048]----+
| . |
|
2. 上传到我购买的 服务器里:
scp ali.pub root@192.168.1.1:/home/root/.ssh/
3. 此时正常通过口令登录到我购买的服务器里, 将ali.pub追加到.ssh/authorized_keys文件里
4. log out from server。Enjoy on my PC。