Remote machine,
$ ssh user@host
$ mkdir -p $HOME/vscodeserver
$ cd $HOME/vscodeserver
$ bash install.sh
$ bash start.sh
c773621a-f86f-4f44-99a8-ef149521765a
[2022-04-14T10:41:07.120Z] info code-server 4.2.0 693b1fac04524bb0e0cfbb93afc85702263329bb
[2022-04-14T10:41:07.121Z] info Using user-data-dir ~/vscodeserver/user-data-dir
[2022-04-14T10:41:07.156Z] info Using config file ~/.config/code-server/config.yaml
[2022-04-14T10:41:07.156Z] info HTTPS server listening on https://127.0.0.1:8080/
[2022-04-14T10:41:07.156Z] info - Authentication is enabled
[2022-04-14T10:41:07.156Z] info - Using password from $PASSWORD
[2022-04-14T10:41:07.156Z] info - Using certificate for HTTPS: ~/vscodeserver/mycert.pem
Local machine,
$ ssh -L 127.0.0.1:8080:127.0.0.1:8080 -N user@host
Then open https://localhost:8080/
in your browser.
VS Code Server docs,
If Chrome refuses to connect to VS Code Server with the self-signed certificates use here, you may, as a workaround, want to use the 'thisisunsafe'-hack discussed here. Or better specify and use "trusted" certificates during VS Code Server start-up, for MacOS e.g. via generating these via your Keychain beforehand.