How to access a server using SSH-keys

How to access a server using SSH-keys


On this post, we are going to configure and access a server using SSH on:

  • Ubuntu 22.04 Linux machine


During my first professional experience as a Data Scientist/ Engineer, I was responsible for a CNN (Convolutional Neural Network) model that predicts if the Electrocardiogram Exams (yes! It is that kind of heart-exam that children use to draw, with a continuous line!) presents a time-sensitive health condition, and if the patient needs to be prioritized for a doctor.

I had to deal with hundred of thousands images and my notebook’s graphic card was not able to deal with this amount of data.

That’s why I had to use SSH to access and run the model in the company CDP server, which was (of course) much more powerful than my notebook, and on this post I will show you how to configure and access a server using SSH.

Commands to use on the:


  • Update package informations from all configured sources:
sudo apt update
  • Install OpenSSH Server packages (“connectivity tool for remote login with the SSH protocol”, source:
sudo apt install openssh-server
sudo systemctl start ssh
sudo systemctl enable ssh
  • Check the status of the service
systemctl status ssh
  • Get the IP address of the server (it will probably start with: “192.168.200…”)
ip address


  • Check if your network connectivity works
ping -c 3 <ip_address_of_your_server>
  • Once you have your network connectivity active, install the SSH key as an authorized key on the server
ssh-copy-id <remote_usr_account>@<IP_address>
  • Test SSH connectivity
ssh <remote_usr_account>@<IP_address>

Conclusion and correlated posts

That is how we can configure and access a remote server using SSH-keys. In the following posts I will show you other important tools to run your model remotely, e.g.:

  • VSCode extension: Remote - SSH,
  • tmux.

See you then!