Article Catalog
preamble
This tutorial will be available atUbuntu
Installation in a server environmentcode-server
and useAndroid
Android Tablet RemoteUbuntu
service for remote programming development to write code. Also paired withcpolar
Intranet penetration tool for offsite remote access to Ubuntu’s code-server in a public network environment.
1.ubuntu local install code-server
Prepare a virtual machine, Ubuntu or centos can be, here toVMwhere ubuntu
system as an example
To download the code server service, please visit the following web browser.https://github.com/coder/code-serverCopy the download link
Open ubuntu command line download
You will be asked to enter your ubuntu login password, enter it and wait for the installation to complete.
The following message indicates successful installation
Next, enter the following command to set the login password for code-server
export PASSWORD=”000000”
View IP address for LAN access
code-server service defaults to port 8080, in order to prevent port 8080 conflict, we modify the code-server port number, enter the following command, edit the configuration file
sudo vim ~/.config/code-server/config.yaml
127.0.0.1 to 0.0.0.0, port 8080 changed to their favorite port, this example is changed to 8077, modify the completion of the save
After setting the password, start the code-server service and enter the following command.
code-server
Address and port number information appears to indicate successful startup
Then open the browser through the LAN ip address to visit http 8077/, appear welcone code-server indicates success, enter the password we set up, login can be.
2. Installation of cpolar Intranet Penetration
Then use cpolar to penetrate the local code-server service, so that android devices can be accessed remotely, write code anytime, anywhere. cpolar supports http/https/tcp protocols, unlimited traffic, easy to operate, no need for a public IP, no router.
cpolar official website:https://www.cpolar.com/
Installation of cpolar intranet penetration (supports one-click auto-installation script)
- cpolar installation (for domestic use)
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
- or cpolar short link installation method: (for foreign use)
curl -sL https://git.io/cpolar | sudo bash
- View version number
cpolar version
- token authentication
Log in to the backend of the cpolar website, click on Authentication on the left side, check your authentication token, and then paste the token into the command line
cpolar authtoken xxxxxxx
- Adding services to the system
sudo systemctl enable cpolar
- Start the cpolar service
sudo systemctl start cpolar
- Check Service Status
sudo systemctl status cpolar
The normal display isactive
Then it indicates that the service is in the normal online startup state.
3. Create a tunnel to map the local port
After installing cpolar Intranet Penetration locally on your ubuntu system, access port 9200 locally on your ubuntu browser, or access port 9200 on your external browser using your LAN ip address, and open the cpolar web ui interface.
After logging in, click on Tunnel Management – Create Tunnel in the left dashboard, and since we configured port 8077 above in code-server, we are going to come and create an http tunnel pointing to port 8077:
- Tunnel name: customizable, be careful not to duplicate the existing tunnel name.
- Protocol: http
- Local address: 8077
- Port type: random domain name
- Region: China vip
strike (on the keyboard)establish
Created successfully we open the list of online tunnels, you can see just created a successful tunnel, there have been generated the corresponding public address, the public address copied down, the next test remote development to write code.
4. Android tablet test access
Open your Android browser, any browser, enter the above link to visit successfully!
5. Fixed domain name public address
In cpolar intranet penetration, because we just created the tunnel selection is free random temporary tunnel, it generates the public address will change within 24 hours, in order to more stable access, we next configure it as a fixed address.
You need to upgrade to the basic package or above to support the configuration of fixed second-level domain name.
log incpolar official website backstage, click on the left dashboard of thereserve
FindReservation of second-level subdomains
, reserving a second-level subdomain for the http tunnel.
- Region: Select server region
- Name: fill in the second-level subdomain you want to keep (customizable)
- Description: i.e. notes, can be customized to fill in
This example reserves a namecodeservertest
of the second-level subdomain. Once the subdomain was successfully reserved, we copied the subdomain and next we need to configure it to bind to the tunnel.
Log in to the cpolar web ui management interface and click on the left dashboard of theTunnel Management
——Tunnel List
to find the tunnel that needs to be configured for the second-level subdomain (in this case, the code-server tunnel), click on the right side of thecompiler
Modify the tunnel information to configure the second-level subdomain into the tunnel:
- Domain name type: change to select
second-level subdomain
- Sub Domain: Fill in the second-level sub-domain we just reserved (in this case, the
codeservertest
)
When the modification is complete, clickupdate
After the tunnel has been successfully updated, click on the left dashboard’sstate of affairs
——Online Tunnel List
You can see the tunnel’s public address, which has been updated to a second-level subdomain, copy the public address down.
Open your Android browser and enter the fixed http link above to access it successfully
5. Conclusion
Use on Androidvscode
The main thing is to connect a remotecode-server
Services.code-server
service is installed in the system, the call is what the system environment, such as here to use theubuntu
carry out the installationcode-server
That’s what the use ofubuntu
environment, such as go, python, java development, you need to install the relevant environment in Ubuntu, the creation of the folder and project is also in theUbuntu
Inside. This way you can actually access thevscode
It can be used anytime, anywhere and is not affected by the device.