Skip to content

hyc0812/remote-control-linuxOS-configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

Turn a computer as a server and access it from everywhere

System used:

  • Ubuntu 20.04

Tools will be used:

Install Zerotier

Sign up an account on zerotier and create a network. It will provide us with a network ID.

Then install the Zerotier on Linux:

curl -s https://install.zerotier.com | sudo bash

Output:

......

*** Success! You are ZeroTier address [ eaXXXXXaXXe ].

Start and enable the zerotier service:

sudo systemctl start zerotier-one.service
sudo systemctl enable zerotier-one.service

Join the network created previously using the network ID:

sudo zerotier-cli join YOUR_NETWORK_ID

Output:

200 join OK

Check if we have joined the network:

sudo zerotier-cli listnetworks

200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>

200 listnetworks afXXXXXXXXXX88c ......

Extra configuration for inbound and outbound rules, sudo might required:

iptables -I FORWARD -i ztc25p4azo -j ACCEPT
iptables -I FORWARD -o ztc25p4azo -j ACCEPT
iptables -t nat -I POSTROUTING -o ztc25p4azo -j MASQUERADE

Install openssh-server:

Install ssh:

sudo apt install openssh-server

Check the installation process:

sudo apt list --installed | grep openssh-server

Output:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

openssh-server/focal-updates,now 1:8.2p1-4ubuntu0.4 amd64 [installed]

Check ssh status:

sudo service ssh status

Output:

● ssh.service - OpenBSD Secure Shell server

Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: e>

Active: active (running) since Fri 2022-04-15 17:57:43 CST; 43s ago

......

Connect to Linux Server:

ssh username@YOUR.SERVER.IP.ADDRESS

Replace your username and IP address.

Enjoy!

Packages

No packages published