root@hello:~/cby# git config --global user.name "cby-chen" root@hello:~/cby# git config --global user.email "cby@chenby.cn" root@hello:~/cby# ssh-keygen -t rsa -C "cby@chenby.cn" Generating public/private rsa key pair. Enter file in which 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:57aHSNuHDLRsy/UVOQKwrUmpKOqnkEbRuRc8jNrGVpU cby@chenby.cn The key's randomart image is: +---[RSA 3072]----+ | .o. | | . = .E +. | | . + * + .. . | | = o.oo.o . + | | o.*...oS.. . o | |.oo.. *o. . | |+. + Oo+ . | |+ . =.=.+ | | oo .o | +----[SHA256]-----+ root@hello:~/cby# cat /root/.ssh/ authorized_keys id_rsa id_rsa.pub known_hosts #需要配置到github上 #https://github.com/settings/ssh/new
root@hello:~/cby# ssh git@github.com The authenticity of host 'github.com (20.205.243.166)' can't be established. ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com,20.205.243.166' (ECDSA) to the list of known hosts. PTY allocation request failed on channel 0 Hi cby-chen! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed. root@hello:~/cby#
*将id_rsa.pub文件中的内容粘贴进去
安装nvm工具
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
root@hello:~/cby# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash root@hello:~/cby# nvm install --lts Installing latest LTS version. Downloading and installing node v16.13.1... Downloading https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz... ############################################################################################################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v16.13.1 (npm v8.1.2) root@hello:~/cby# nvm use --lts Now using node v16.13.1 (npm v8.1.2) root@hello:~/cby# root@hello:~/cby# node -v v16.13.1 root@hello:~/cby#