Why am I doing this:#
- I like to use
vscode remote ssh
to connect to cloud services for development servers. - My cloud service configuration is low (2C2G), and when doing front-end development, the high disk IO can cause the cloud server to crash.
- I have a relatively high-spec idle laptop (I5 12400 18G).
- The company can access the external network and has uninterrupted power supply.
How to do it:#
- Install your favorite Linux distribution on the laptop (I installed Ubuntu 22.04, remember to choose minimal installation, do not select updates, enable lvm, skip Ubuntu Pro), and place it in the company.
- Self-build Zerotier on the cloud server.
- All devices join the Zerotier network as Leaf nodes.
What it looks like#
All devices are interconnected to achieve remote access to high-performance workstations.
How to set up#
Refer to this repository:
https://github.com/xubiaolin/docker-zerotier-planet
Enable Ubuntu ssh#
apt install openssh-server
vi /etc/ssh/sshd_config
# Modify the port and PermitRootLogin yes
sudo systemctl restart sshd
sudo systemctl enable sshd
Prevent the laptop from sleeping when the lid is closed:#
vi /etc/systemd/logind.conf
HandleLidSwitch=ignore
service systemd-logind restart
Operations and Maintenance#
https://docs.zerotier.com/config
By default, the ZeroTier API can only be accessed locally. You need to configure local.conf to allow access from other locations. Simply create a new file in the container:
I have created a simple node offline email notification using the API:
https://github.com/Etuloser/ZeroTier-Monitor