Share your PC’s Internet to the Ubuntu Server through SSH

Best case: your PC can SSH into the Ubuntu server

Run this on your PC:

ssh -N -R 127.0.0.1:1080 ubuntu_user@UBUNTU_SERVER_IP

This creates a SOCKS proxy on the Ubuntu server at:

127.0.0.1:1080

Traffic from the Ubuntu server will go through SSH and exit from your PC’s internet connection.

On the Ubuntu server, test it:

curl --proxy socks5h://127.0.0.1:1080 https://ifconfig.me

Other case: Ubuntu server can SSH into your PC

Then run this on the Ubuntu server:

ssh -N -D 127.0.0.1:1080 pc_user@PC_IP
curl --proxy socks5h://127.0.0.1:1080 https://ifconfig.me

More reliable option: use an HTTP proxy through SSH

Run an HTTP proxy on your Windows PC

For example, if you already use one of these apps:

App Common HTTP / mixed proxy port
v2rayN 10809 or similar
Clash Verge / Clash for Windows 7890
NekoRay / NekoBox usually configurable

Use the app’s HTTP or mixed proxy port.

ssh -N -R 127.0.0.1:1080:127.0.0.1:7890 ubuntu_user@UBUNTU_SERVER_IP

 

Blank Screen on Ubuntu Server

Blank screen after idle: setterm --blank 1 (the number is the timeout in minutes)

Blank screen immediately: setterm --blank force

To turn the screen back on, run setterm --blank poke

Permanent Solution (Automatic on Boot)

sudo nano /etc/systemd/system/setterm-blank.service
[Unit]
Description=Blank screen after 1 minute idle
After=multi-user.target

[Service]
Type=oneshot
Environment="TERM=linux"
ExecStart=/usr/bin/setterm --blank 1 --term linux
StandardOutput=tty
TTYPath=/dev/tty0

[Install]
WantedBy=multi-user.target
sudo systemctl enable setterm-blank.service
sudo systemctl start setterm-blank.service

Or

sudo nano /etc/default/grub

Find the line GRUB_CMDLINE_LINUX_DEFAULT and add consoleblank=60 (60 = seconds before blanking):

GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=60"
sudo update-grub
sudo reboot