Search This Blog

Showing posts with label SSH. Show all posts
Showing posts with label SSH. Show all posts

Friday, January 19, 2024

Raspberry Pi 5: Ubuntu server installation

Prerequisites

To get Ubuntu Server on Raspberry Pi it was actually as easy as just getting the Raspberry Pi imager from the official website.

Install it and run it directly.

Choose device (raspberry pi 5), choose OS (other general-purpose OS -> Ubuntu -> Ubuntu Server)

Choose a device to flash it to.

You will have options to include into your file, these are important. You want to set up wifi, make sure SSH is active and set an admin login, this is used later when you SSH in with PowerShell and when you login to the server with RDP. 

Flash the OS to the SD card, you are now done with the first step.

First time booting Ubuntu Server on Raspberry Pi 5

Put the SD card in the device. Keyboard, mouse and monitor is optional as you can manage the device wirelessly and remotely right away if you performed the options detailed in part 1.

Go to your router and find the IP address of the device, this is used in next step.

Open PowerShell and write ssh admin@192.168.0.X where admin is the user name and X is the last part of the IP address. Confirm with password. SSH is a secure alternative to Telnet.

You will then be taken to an admin prompt that takes linux commands.
You might want to start with the following command:

sudo apt-get update && sudo apt-get upgrade

Make sure to confirm if it prompts you.  

GUI and RDP to Ubuntu Server

The last step was to configure a desktop experience and RDP.

For the deskop experience I simply ran two commands, it would seem that the first one is required.

sudo apt install ubuntu-desktop-minimal

sudo apt-get install xfce4

If prompted, I went with the option lightdm and I restarted all serviced that asked me too, some which also disconnected me from the internet.

For the RDP I first ran the following command:

sudo apt install xrdp -y

Followed by this command that shows you if the installation went alright.

sudo systemctl status xrdp

After that I could RDP using the built-in solution on Windows. Some sources claim you need to fix ssl certs and restart the service, but I could start it right away.

Configure your RDP from your Windows computer

Configure a RDP link on your desktop with the following steps:

1. Open remote desktop connection from your start menu

2. Pick "show options"

3. Computer should be the IP address, user name is the one you entered at the flashing of the image

4. Save as, place it in a good location. Now you can use it and just entering your password.

When you login using RDP you will be greeted with a more familiar desktop experience.


Enjoy!

Saturday, May 27, 2023

Telnet: A quick overview

Overview

Telnet is a tool for administrating servers remotely. The name stands for Teletype Network and was invented pre-internet. As a consequence it is also an unencrypted way of communicating with a server. It should therefore not be used over the internet as the traffic may be intercepted, for example using Wireshark. 

Apart from servers it can also talk to other equipment such as network switches and routers. If the equipment is old, it might only be able to use Telnet instead of the encrypted tool called SSH (Secure Shell).

It is a command line tool that you can run on Windows, Mac and Linux which communicates bidirectionally. 

From a technical point of view it is a client/server type of protocol. The terminal captures keystrokes, the client converts it to a universal language that then goes through the TCP/IP protocol and through a network virtual terminal which sets a mutual standard for both machines.

It then goes through the TCP/IP stack on the receiving server side, the Telnet server converts/reverses the universal language to a language that the receiving system understands. The pseudoterminal then executes the commands and runs the applications.

Activating and deactivating Telnet Client

On a Windows machine you can activate it by going to the control panel, then select programs and features, then press "turn Windows features on or off".


Another way of activating Telnet is by using an elevated PowerShell prompt.

You can run the following commands to either activate or deactivate Telnet.

Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient

Disable-WindowsOptionalFeature -Online -FeatureName TelnetClient


Using Telnet commands

If you write telnet followed by a target address followed by a space and a port number, you will use a different Telnet version. It can look like this if you try to connect to your local gateway:

telnet 192.168.0.1 23 

If you get stuck on "Connecting to 192.168.0.1..." it means that the port is closed and that Telnet won't work. Use the escape key to cancel. On a US keyboard it is Ctrl + ], on a Swedish keyboard your Telnet escape key is Ctrl + ¨.

Use telnet /? to open some the related help text.

You might experience lag when sending the commands, this is because the keystrokes has to travel back and forth over the network once you are connected via Telnet.


If only you write Telnet, you will instead open the Microsoft Telnet context.

To open a connection:
o google.com 443

To close a connection:
c google.com 443

To quit the Telnet context that you opened, simply use the command quit.

For more commands check the Microsoft page.

Summary

Telnet is an old and insecure way of communicating with servers, routers and switches. It is a text based tool run in the command prompt or PowerShell. Use SSH as a better alternative unless you work with legacy equipment that only can handle Telnet. Telnet is and should be disabled by default unless you have reasons to keep it active.