- Install Ceph Storage Cluster on Ubuntu 20.04. Before you begin the deployment of Ceph Storage Cluster on Ubuntu 20.04 Linux servers you need to prepare the servers needed. Below is a picture of my servers ready for setup.
- A quick guide to setup a SSH-conncection to Virtual Machine Ubuntu Server 20.04. This article shall serve to prevent wasting hours looking for the pitfalls I encountered setting up Ubuntu Server 20.04 on my Virtual Box host (Ubuntu, Windows and Mac). Install Ubuntu Server Image in Virtual Box. Download and install the.iso-file as described here.
- Ubuntu Ssh Client
- Ssh Config File Ubuntu 20.04
- Where Is Ssh Config Ubuntu
- Start Ssh Server Ubuntu 20.04
It also adds a security policy to filter out unwanted traffics for web or office users. This page explains how to install, set up, and configure the Squid proxy server on Ubuntu 20.04 LTS Linux server. Step 1 – Install Squid proxy server on Ubuntu. First, log in using the ssh command: ssh user@server-ip-here ssh vivek@server1.cyberciti.biz. There is no sshdconfig for me, there is an sshconfig but the contents are completely different from what’s shown. Adi Chiru October 17, 2016 at 5:58 pm sshdconfig is the configuration od the ssh server (the daemon is called sshd). Sshconfig is the configuration of the client (ssh is the command to use the client).
In this tutorial you’ll learn how to install Ubuntu 20.04 on Raspberry Pi 4, without needing any external monitor/keyboard/mouse.
Just your computer (with which you’re reading this tutorial now), your Raspberry Pi 4 board, a micro SD card, and the power cable.
I will also show you how to completely configure Ubuntu server on your Pi4, using ssh.
Which configuration for your Raspberry Pi 4 board?
When you buy a Raspberry Pi 4 board you can choose between different amounts of RAM: 1, 2, 4, or even 8 GB.
Once installed and configured, you can expect Ubuntu server to take something like 200MB minimum, without counting the RAM in cache (this is the data I got with the steps of this tutorial).
So, 1GB of RAM is possible, but you have to be careful when you start something, because your amount of available RAM is quite limited. I recommend you choose at least the Pi4 version with 2GB of RAM. The price difference between the 1GB and 2GB versions is not huge.
You are learning how to use Raspberry Pi to build your own projects?
Check out and learn step by step.
If you only have a 1GB RAM board available, it’s ok! Everything will still work. In fact, before Raspberry Pi 4, boards like Pi 2, Pi 3B, and Pi 3B+ only had one possible hardware configuration: 1GB RAM. So if it was possible then, it is possible now. 2+GB of RAM will simply allow you to launch more/bigger programs and care less about RAM usage.
Download Ubuntu 20.04 image for Raspberry Pi
Go to the Ubuntu download page for Raspberry Pi images, and download the 64-bit version for Raspberry Pi 4.
This will take you to a “Thank you” page, and the download will start. The file size should be between 600-700MB.
Flash Ubuntu image into a micro SD card
Extract the image
Now that you have the file, first, and this is important, extract the image from the archive. Because what you get is not directly the image, it’s an archive containing the image. In my case, the image size, after extraction, was about 3.2 GB.
micro SD card requirements
The micro SD card you have must be a class 10 card. To verify that check your card and if you see “10” within a circle then it’s OK.
Also, your card should have at least 8GB of space. 8GB is the minimum so you can run the OS + install a few things, but if you can, aim for 16GB or 32GB.
Flash the image
To flash the image into your micro SD card you’ll need a software. (Well you could just use command lines from Linux but I’ll stick to the software here). A nice software I often use is balenaEtcher, which is compatible with Windows/Linux/MacOS.
Download balenaEtcher, install it and start it.
Then, plug your micro SD card to your computer, it should be automatically detected. Finally, click on the “Flash from File” button to select the Ubuntu image. Note: select the image, not the archive file!
Click on “Flash” and wait until it’s done. This can take a few minutes. Once done, depending on the options you’ve chosen, the card may be ejected.
Setup Wi-Fi and ssh for your Raspberry Pi 4 without a monitor
Great, now your micro SD card contains Ubuntu server for Raspberry Pi 4.
BUT, the configuration is not complete yet. As we won’t use any external monitor/keyboard/mouse we first need to configure the Wi-Fi directly from the SD card, and make sure we can ssh into it. Don’t worry though it will be quite easy.
So, put back your micro SD card into your computer.
Setup Wi-Fi directly from your SD card
Navigate inside the root folder of the card. The name should be something like “system-boot”.
Find the file named “network-config” and open it in a text editor. On Windows, you can right-click -> “open with” and select any text editor you want.
The file should contains this:
Ubuntu Ssh Client
Add your Wi-Fi name and password just after the ethernet configuration.
A few things to pay attention to:
- Make sure the indentation is exactly 2 spaces. No tab, no 4 spaces.
- Replace YOUR_WIFI_NAME with your actual Wi-Fi name. Keep the quotes “”.
- Replace YOUR_WIFI_PASSWORD with the password for the Wi-Fi. Keep the quotes “”.
- Of course, this Wi-Fi network should be the same as the one your computer is currently connected to, otherwise the rest of this tutorial won’t work.
Save the file and that’s it.
ssh setup
For ssh, you should not need to do anything.
If you go into the “user-data” file, also inside the root directory of your SD card, you should see:
So, we’ll be able to connect to the Pi via ssh, and we have the initial username and password: ubuntu:ubuntu.
First Ubuntu 20.04 boot on Raspberry Pi 4 – Find the Pi’s IP address
Eject and remove the micro SD card from your computer. Make sure your Pi is powered off (power cable removed), put the micro SD card in the corresponding slot, and only then power on your Raspberry Pi 4.
At this point, you don’t have any visible output since you don’t have a monitor. But you should see the green LED on the Pi blink randomly. It means the Pi is booting and working with the SD card. If the green LED is not blinking randomly, maybe it’s because the flash operation was not successful.
The Pi 4 will try to connect to your Wi-Fi network, using the name and password you’ve provided.
Now, the next step is to find what is the IP address of the Pi inside the network.
Important Note: with the following instructions, if you don’t see your Pi address at first, and if you’ve waited at least 2 minutes, power off/power on the Pi again. When I first booted the Pi with this Ubuntu image, it didn’t connect to the Wi-Fi. After I restarted it once, it worked.
On Windows
If you’re on Windows, you can use the Advanced IP Scanner tool.
All you have to do is click on “Scan” and wait.
OK, found it!
The Raspberry Pi 4’s IP address, in my case, is 192.168.43.56, and the name of the machine is “ubuntu”.
On Linux/Ubuntu
If you’re already running Ubuntu on your computer (natively or within a virtual machine), you can use only the terminal to find the Pi’s address.
I usually use nmap to do that (sudo apt install nmap
).
First find your network IP address and mask. Run ifconfig
:
In this case, the IP address of my Ubuntu host is 192.168.43.138, and the mask is 255.255.255.0 (24 bits).
Now, with nmap and the data you just got:
And we find the IP address: 192.168.43.56.
First ssh connection to the Raspberry Pi 4
Connect to the Pi wish ssh
If you’re on Windows (older than Windows 10 with October 2018 update), use a program such as Putty.
Put the IP address of the Pi and click on “Open”.
You’ll be asked to give username and password. Simply use “ubuntu” twice.
If you’re on Linux (or Windows 10 recently updated), simply connect to the Pi from a terminal, with the ssh command line tool: ssh ubuntu@ip_address
, and use “ubuntu” for the password.
Password change
The first time you connect to your Pi, you will be asked to change the default password (“ubuntu”).
Once done, the connection will be closed.
Now, you can connect to your Pi again, using “ubuntu” as the username, and the new password you’ve just set.
Configure Ubuntu 20.04 on your Raspberry Pi 4
From now on, I will assume that you’re connected to your Pi via ssh. All the commands will be executed directly on the Pi.
Correctly synchronize date on Ubuntu
It is possible that the date is not correctly synchronized.
Ssh Config File Ubuntu 20.04
To check that, simply execute date
:
If the date+time is not correct, first check that your Pi is connected to the Internet. Even if it is connected to a Wi-Fi network, maybe this network doesn’t have access to the Internet. For a very quick check, see if the command ping ubuntu.com
gives you a positive result.
If you get that you can be sure your Pi has access to the Internet.
Now, if the date is still not synchronized, then you can simply solve that by installing htpdate: sudo apt install htpdate
. After that, execute date
again and you should have the current date. (you could solve that issue with a bunch of different solutions, but to keep things simple here I just used htpdate).
Note: here is a possible error output you can get with sudo apt update
(which we’ll run later in this tutorial) if your date is not correct.
Set your time zone
The default time zone will be UTC0.
Run timedatectl list-timezones
to list all available time zones.
Then, run timedatectl set-timezone your_time_zone
to set the time zone, for example timedatectl set-timezone Europe/Paris
.
Update/upgrade packages
One of the first thing you want to do with a fresh installation is to upgrade all the packages you have to the newest version.
And then reboot. Your Pi is fully ready now.
Optional: install a desktop
By default, when working with this Ubuntu server installation, you’ll connect to the Pi via ssh and always work like that.
But, if you ever need to use a desktop with a monitor for a specific application, you can get one.
You can choose between:
- ubuntu-desktop
- xubuntu-desktop
- lubuntu-desktop
- kubuntu-desktop
To install a desktop for Ubuntu, simply use sudo apt install ubuntu-desktop
for example.
However, note that the installation is quite big (2.7GB for ubuntu-desktop) and even if you still use your Pi headless (without a monitor), the RAM usage will be higher. So, only install a desktop if you truly need one.
Your Raspberry Pi4 is now ready with Ubuntu 20.04
Well done, your Pi is correctly configured!
Now you can start working on your projects. Before you do so, you may install your favorite text editors/debug tools/utilities/etc.
Then, well it depends on what you want to do.
If you are working with robots, the combination Raspberry Pi 4 + Ubuntu 20.04 server is great.
For example you can start playing with GPIOs using the RPi.GPIO Python module, or even work with ROS2 to build a complete and scalable application.
SSH (Secure Shell) is an encrypted protocol which allows client system to communicate securely with a server. You can connect to your system remotely, perform administrative tasks and access files. It’s more secure way to communicate with server using SSH keys than password authentication. This tutorial explains how to create SSH keys on Ubuntu 20.04 Focal Fossa.
Create SSH keys on Ubuntu#
Before you start, make sure you are logged in as root or user with sudo privileges.
Step 1 – Create Key Pair#
At first, we will create a key pair on client system using below command:
By default, latest version of ssh-keygen
will generate 3072-bit RSA key pair. If you wish to create larger 4096-bit key then pass -b 4096
in flag.
Above command should show output like below:
Hit the Enter
key to save the key pairs at ./ssh
directory or you can specify location as per your choice.
Next, it will prompt to enter a secure passphrase. Passphrase will add an additional security layer to your keys. It is optional, whether you want to set or skip it by just hitting Enter
key.
Next, you will see output as following:
Now you have public and private keys which you can use to authenticate with your Ubuntu server.
You also can verify that your files are generated or not by typing:
It will show output like this:
Step 2 – Copy Public Key to Server#
Next step is to place public key to your Ubuntu server. Simple and fast way to copy public is to use ssh-copy-id
utility. Run the below command:
You will be prompted to enter password for your username:
Once the user is authenticate successfully, the public key will be appended to ~/.ssh/authorized_keys
file on remote user and connection will be disconnected.
If your local system don’t have ssh-copy-id
utility installed then you can use following command to copy the public key:
Ensure that you have password-based SSH access to your server then only you can use above method.
Step 3 – Login to the Server using SSH Keys#
Now, you should be able to login to the remote machine without the remote user’s password.
Try to connect using SSH command:
If you are first time to login then it may prompt you as following. Type yes and hit Enter key to continue:
Now, if you haven’t set passphrase for your keys then you will be logged in immediately without asking passphrase. Otherwise it will be asked to enter passphrase. After successful authentication, a new shell session will open your user account on the Ubuntu server.
Step 4 – Disable SSH Password Authentication#
You can add one more security layer by disabling the password authentication for SSH. Before starting process, make sure that you are able to authenticate to your server without entering password and must have sudo enabled user account.
Let’s login to your server using ssh:
Now edit the SSH configuration file located at /etc/ssh/sshd_config
:
Find PasswordAuthentication
directive and if line commented out then uncomment the line and set the value to no
as given below:
Save and close the file. You must need to restart the SSH service using below command:
At this point, password-based authentication is disabled on your Ubuntu server.
Conclusion#
You learned how to create a new SSH keys pair and set up an SSH key-based authentication on Ubuntu 20.04 machine. You can set up same key to multiple remote hosts. At the end, you also learned how to disable SSH password authentication.
Where Is Ssh Config Ubuntu
By default, SSH listens on port 22. You can reduce the risk of automated attacks by changing the default SSH port.
If you have any question or suggestion, please leave comment below.
If our content helps you, please consider buying us a coffee
Start Ssh Server Ubuntu 20.04
Thank you for your support.