This assumes you already have an Ubuntu server built and running. There are three ways in and they are not interchangeable. Learn the console first, because it is the one that still works on the day SSH stops answering.
The console is a screen attached to the machine, real or virtual.
It is the most powerful connection you have. It behaves as though you are standing at the box.
Kernel changes, recovery mode and resetting a root password you have locked yourself out of all need the console. SSH cannot do any of that.
SSH is the everyday connection. It is what you will use for almost all work.
SFTP and FTP move files. That is a separate job and a separate tool.
Learn the console even though SSH is nicer. The day you need it is the day SSH is broken.
Open your hypervisor and connect to the virtual machine.
In Hyper-V, right click the machine and click Connect.
Every hypervisor has this. VMware, VirtualBox and Proxmox all give you a console button.
Log in with the user you created at install time.
Show the network interfaces with command ip a
Read the address off your ethernet adapter and write it down.
You need it for every remote connection from here on.
Check the service with command systemctl status sshd
Look for active and running.
Confirm something is listening on the port with command
sudo lsof -i -P -n | grep sshd
sshd 812 root 3u IPv4 0t0 TCP *:22 (LISTEN)
That line is the proof. The service being started and the port being open are two different facts.
Check the firewall is not eating the connection with command sudo ufw status
Inactive is fine here. If it is active and you cannot connect, that is your answer.
Do these three checks before you start blaming your client. They take ten seconds and they tell you which side the problem is on.
Open Manage optional features and search for OpenSSH.
Install the client if it is not there. On Windows 10 and later it usually already is.
Open PowerShell.
Connect with command ssh [email protected]
Use your own username and your own address.
If the server listens on a non standard port, name it with the port flag.
ssh [email protected] -p 2222
The first connection asks whether the authenticity of the host can be established. Answer yes.
Then enter the password for that user.
Do this every single time you connect. It costs three seconds.
Confirm the machine with command hostname
Confirm the user with command whoami
Confirm where you are starting from with command pwd
ubu-2002
sun
/home/sun
Right box, right user, right directory. Now you can start work.
Download and install PuTTY.
https://www.putty.org/
Open it and paste your server address in.
Give the session a name and click Save.
Saved sessions load with Load, which saves retyping the address every time.
Click Open to connect.
Accept the security alert on the first connection.
Log in and run the same three checks.
File system navigation is the next thing to learn, and it is the skill everything else sits on.