#生成ssh公私钥 root@instance-11:~# ssh-keygen Generating public/private rsa key pair. Enter file inwhich to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa Your public key has been saved in /root/.ssh/id_rsa.pub The key fingerprint is: SHA256:GNFQcUlqIja8tIeUeEXAIIOoRo3otaEBqRV+Xd1+QvY root@instance-11 The key's randomart image is: +---[RSA 3072]----+ |O.=+.o=+++oo | |=B.*.+ o.oo + | |=.* & + o + . | |o+ B * = o E | |. + o S o | | . | | | | | | | +----[SHA256]-----+
#把公匙发送到目标主机上 root@instance-11:~# ssh-copy-id [email protected] /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '35.241.109.176 (35.241.109.176)' can't be established. ECDSA key fingerprint is SHA256:+PPrYot1CRFCSpSiC4JXSU98W6zZdOXsVeCBYCSJviY. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes /usr/bin/ssh-copy-id: INFO: attempting to login with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys [email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'" and check to make sure that only the key(s) you wanted were added.
root@instance-11:~# cd algo/ root@instance-11:~/algo# ./algo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#保存密码更新用户会用到 "msg": [ [ "\"# Congratulations! #\"", "\"# Your Algo server is running. #\"", "\"# Config files and certificates are in the ./configs/ directory. #\"", "\"# Go to https://whoer.net/ after connecting #\"", "\"# and ensure that all your traffic passes through the VPN. #\"", "\"# Local DNS resolver 172.24.176.178 #\"", "" ], " \"# The p12 and SSH keys password for new users is ZC2uTzzGV #\"\n", " \"# The CA key password is uXaHQizfZPbkszV@ #\"\n", " " ] }