Ssh
Open SSH as server
- Install SSH server
If SSH is running, you will see
sudo apt update sudo apt install openssh-serve sudo systemctl status ssh # Check ssh running status
Active: active (running)
in the output information. - Allow SSH to go through firewall
- Check if the firewall is activated:
sudo ufw status
. If inactivated, you will seeStatus: inactivate
. - Allow SSH to go through firewall:
sudo ufw allow OpenSSH
- Activate firewall (if inactivated):
sudo ufw enable
- Check firewall status:
sudo ufw status
, and you will see information likeStatus: active
...
- Check if the firewall is activated:
- Check IP of the server. You can use anyone of the following commands:
ifconfig ip addr show | grep inet hostname -I
Connect the server by SSH from a client
ssh <username>@<server_ip_address>
Note that <server_ip_address>
can be either ipv4 or ipv6.