code-server 使用 hash-password

👤 Tiger   📅 2023-07-19 20:08

生成密码

# 需要安装nodejs
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install npx

# 生成密码
echo -n "thisismypassword" | npx argon2-cli -e
$argon2i$v=19$m=4096,t=3,p=1$wst5qhbgk2lu1ih4dmuxvg$ls1alrvdiwtvzhwnzcm1dugg+5dto3dt1d5v9xtlws4

修改 `~/.config/code-server/config.yaml`

auth: password
hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wst5qhbgk2lu1ih4dmuxvg$ls1alrvdiwtvzhwnzcm1dugg+5dto3dt1d5v9xtlws4"

修改后重启 code-server 服务或容器


END

Comments