Senin, 31 Mei 2021

Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool

Want to do some fun stuff in the Linux terminal? How about converting a regular image into an ASCII art?

You know what’s ASCII? It’s a standard that assigns letters, numbers and other characters in the 256 slots available in the 8-bit code. The ASCII art is a graphics composed of the printable ASCII characters. Basically, it is composed of a bunch of letters, numbers and special characters.

You might have seen people displaying their distribution’s logo in ASCII format like this:

Ubuntu Mate Focal Neofetch

That’s cool, right? How about converting a normal picture into ASCII art? That’s what you are going to explore in this article.

Ascii Image Converter

As the name suggests, Ascii Image Converter is a tool that converts an image into ASCII art. It is a command line based tool written in Go and it prints the ASCII version of the image supplied to it.

You probably won’t recognize me, but that’s me in ASCII in the image below. That’s my 8-bit avatar.

abhishek prakash in ascii

The tool supports input images in the following format:

  • JPEG/JPG
  • PNG
  • BMP
  • WEBP
  • TIFF/TIF

Let’s see about installing and using it.

Installing Ascii Image Converter on Linux

This nifty tool is also available on Windows but I am not going that way. Let’s stick to Linux in this tutorial.

If you have Snap enabled in your distribution, you can easily install its snap package using the following command:

sudo snap install ascii-image-converter

You may also download the Linux executable file from its release page and put the executable in the /usr/local/bin/ directory. This way, you’ll be able to run it like a regular Linux command. If you wonder why so, please learn about Linux directory hierarchy.

Using Ascii Image Converter

The usage is simple. Once installed, you just have to provide the path of the image you want to convert.

ascii-image-converter path_to_image

You may also provide the URL of the image to convert an image into ASCII directly from the web.

Here is my profile picture converted into ASCII. I have put my original photo for the reference.

Abhishek Prakash ascii converted

You may also have a colored ASCII conversion.

ascii-image-converter -C path_to_image
Abhishek colored ascii

You may convert multiple images into ASCII by providing their paths. It will print the ASCII version one after another on the terminal display.

There is an option to save the generated ASCII art but as a text file, not as an image. The command below will save the ASCII art by adding “-ascii-art.txt” to the image name in the directory path passed to the flag.

ascii-image-converter path_to_image -s .

There are a few more options available such as giving the output a specific dimension, use more ASCII characters, or use your own set of characters for printing the ASCII art. You can read about it on the project’s repository.

Like it?

Do you like more ASCII stuff? How about playing ASCII games on Linux? Yes, you can totally do that.

If you like experimenting in the terminal, you may like this tool. Though I wonder what could be a good practical use of an ASCII converted image. Any ideas?



from It's FOSS https://ift.tt/3uFj359
via IFTTT

Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim

You get plenty of open-source web browsers available for Linux. Not just limited to chrome-based options, but chrome alternatives as well.

Most of the options available focus on a pretty user experience while offering privacy features.

However, Nyxt browser may not be built for the best user experience in mind but something that power users love.

Nyxt Browser: Open-Source Browser That Focuses on Keyboard Shortcuts and Commands

nyxt browser

Nyxt is a keyboard-oriented open-source web browser available for Linux and macOS.

Of course, not every power user utilizes keyboard shortcuts, but this aims to cater the needs of users who prefer to navigate via the keyboard.

It is inspired by how the keyboard shortcuts in Vim and Emacs work — so if you are comfortable with those editors, the shortcuts will feel familiar to you.

Unlike mainstream web browsers, you do not have to navigate your way inside multiple settings and menu, you will get all the functionality that you need to access with a quick shortcut or a command.

In case you were wondering, it is web engine agnostic, but it currently supports WebEngine and WebKit.

So, it saves time and improves your browsing experience if you are a fan of navigating around using the keyboard.

It offers a fair share of useful features which I shall highlight below.

Features of Nyxt Browser

nyxt browser

You will find many non-conventional features offered here. Before exploring each of the key highlights mentioned here, you might want to go through the official documentation (press F1 to find it) that should be linked in the welcome screen:

  • Lossless tree-based history (track the exact hierarchy of your history and easily recall what you navigated to)
  • Clipboard history to help you quickly find what you copied earlier
  • Keyboard shortcut to start entering commands (CTRL+ Space)
  • Navigate your way through lengthy documents using keyboard shortcuts to jump to a specific heading
  • Buffers instead of tabs which isolates behavior and settings of every tab from one another
  • Ability to close multiple tabs by mapping them with a common element
  • Mouseless navigation
  • Quickly find a buffer using search instead of looking for it among many tabs
  • Ability to run short scripts as per your workflow
  • Customizable auto-fill feature with which you can also have the current date filled in automatically in a form
  • In-built adblocker

In addition to the features highlighted above, you will get the ability to toggle a dark mode, HTTPS mode, and a ton of options from the command menu.

Moreover, it is completely customizable and programmable. So, you can choose to tailor it for yourself.

Install Nyxt Browser in Linux

nyxt browser settings

For Ubuntu-based distributions, you will find a deb package available from the official download page.

You might want to go through the ways to install deb files if you did not know.

It is available in AUR for Arch Linux users and offers packages for Alpine Linux, Nix, and Guix.

You should also find the source in the GitHub page if you need to compile it.

Wrapping Up

While Nyxt browser may not be the most user-friendly browsing experience out there, it is certainly a special option for users who can make the most out of keyboard shortcuts and commands.

If you wanted a mouseless navigation experience, this is the browser to try. I’d suggest you to try it anyway – but if you do not generally use keyboard shortcuts to navigate, this would prove to be a complicated experience for you.

Have you tried Nyxt browser ever before? Let me know your thoughts in the comments below.



from It's FOSS https://ift.tt/3c45QMC
via IFTTT

Sabtu, 29 Mei 2021

Complete Guide to Configuring SSH in Ubuntu

SSH has become the default method of accessing a remote Linux server these days.

SSH stands for Secure Shell and it’s a powerful, efficient, and popular network protocol used to establish communication between two computers in a remote fashion. And let’s not forget the secure part of its name; SSH encrypts all traffic to prevent attacks like hijacking and eavesdropping while offering different authentication methods and a myriad of configuration options.

In this beginner’s guide, you’ll learn:

  • The basic concept of SSH
  • Setting up SSH server (on the system you want to access remotely)
  • Connecting to remote server via SSH from the client machine (your personal computer)

The absolute basics of SSH

Before you see any configuration process, it will be better to go through the absolute basic concept of SSH.

The SSH protocol is based on server-client architecture. The “server” allows the “client” to be connected over a communication channel. This channel is encrypted and the exchange is governed by the use of public and private SSH keys.

ssh diagram
Image credit: SSH

OpenSSH is one of the most popular open source tools that provides the SSH functionality on Linux, BSD and Windows.

For a successful SSH set up, you need to:

  • Have SSH server components on the machine that acts as the server. This is provided by openssh-server package.
  • Have SSH client component on the machine from where you want to connect to the remote server machine. This is provided by openssh-client package and most Linux and BSD distributions come preinstalled with it.

It is important to keep a distinction between the server and client. You might not want your personal computer to act as SSH server unless you have good reasons where you want others to connect to your system via SSH.

Generally, you have a dedicated system working as the server. For example, a Raspberry Pi running Ubuntu server. You enable SSH on the Raspberry Pi so that you could control and manage the device from your main personal computer using SSH in a terminal.

With that information, let’s see how you can set up a SSH server on Ubuntu.

Configuring SSH Server on Ubuntu

Setting up SSH is not complicated and just needs a few steps to do it.

Prerequisites

  • A user with sudo privileges on the server machine
  • Internet connection to download the required packages
  • At least another system in your network. It can be another computer on your LAN, a remote server via Internet, or a virtual machine hosted in your computer.

Again, the SSH server installation should be done on the system that you want to act as server and to which you want to connect remotely via SSH.

Step 1: Install required packages

Let’s start by opening a terminal window to enter the necessary commands.

Remember to update your Ubuntu system before installing new packages or software with to make sure that you are running the latest versions.

 sudo apt update && sudo apt upgrade 

The package you need to run SSH Server is provided by openssh-server component from OpenSSH:

sudo apt install openssh-server
Installing openssh-server

Step 2: Checking the status of the server

Once the downloading and installation of the package is done the SSH service should be already running, but to be sure we will check it with:

service ssh status

You may also use the systemd commands:

sudo systemctl status ssh

You should see something like this, with the word Active highlighted. Hit q to return to the command prompt.

Checking ssh service status

If in your case the service is not running you will have to activate like this:

sudo systemctl enable --now ssh

Step 3: Allowing SSH through the firewall

Ubuntu comes with a firewall utility called UFW (UncomplicatedFirewall) which is an interface for iptables that in turn manages the network’s rules. If the firewall is active, it may prevent the connection to your SSH Server.

To configure UFW so that it allows the wanted access, you need to run the following command:

sudo ufw allow ssh

The status of UFW can be checked running sudo ufw status.

At this time our SSH Server is up and running, just waiting for a connection from a client.

Connecting to the remote system from your local machine

Your local Linux system should already have SSH client installed. If not, you may always install it using the following command on Ubuntu:

sudo apt install openssh-client

To connect to your Ubuntu system you need to know the IP address of the computer and use the ssh command, like this:

ssh username@address 

Change username to your actual user in the system and address to the IP address of your Ubuntu machine.

If you don’t know the IP address of your computer you can type ip a in the terminal of the server and check the output. You should have something like this:

ssh find ip
Using “ip a” to find the IP address

As can be seen here my IP address is 192.168.1.111. Let’s try connecting using the username@address format.

ssh team@192.168.1.111

The first time you connect to a SSH server, it will ask for permission to add the host. Type yes and hit Enter to continue.

Connecting for the first time with SSH
First time connecting to the server

Immediately SSH tells you that the host was permanently added and then asks for the password assigned to the username. Type in the password and hit Enter one more time.

SSH asking for password
Host added, now type in the password

And voila! You will be logged into your Ubuntu system remotely!

Connected with SSH
Connected!

Now you can work in your remote system’s terminal as normal.

Closing the SSH connection

To close the connection you just need to type exit and it will close it at once, without asking for confirmation.

Closing the connection with exit
Closing the connection with “exit”

Stopping and Disabling SSH in Ubuntu

If you want to stop SSH service you will need this command:

sudo systemctl stop ssh

This will stop the service until you restart it or until the system is rebooted. To restart it, type:

sudo systemctl start ssh

Now, if you want to disable it from starting during system boot, use this:

sudo systemctl disable ssh

This won’t stop the service from running during the current session, just from loading during startup. If you want to let it start again during system boot, type:

sudo systemctl enable ssh

Other SSH clients

The tool ssh is included in most *nix systems, from Linux to macOS, but those are not the only options in existence, here are a couple of clients that can be used from other operating systems:

  • PuTTY is a free SSH client for Windows and it’s open source. It’s full of features and very easy to use. If you are connecting to your Ubuntu machine from a Windows station, PuTTY is a great option.
  • JuiceSSH is an amazing tool for Android users. If you are on the go and need a mobile client to connect to your Ubuntu system, I amply recommend giving JuiceSSH a go. It’s been around for almost 10 years and it’s free to use.
  • And finally, Termius is available for Linux, Windows, macOS, iOS, and Android. It has a free tier version and also several premium options. If you are running a lot of servers and working with teams sharing connections then Termius is a good option for you.

Wrapping Up

With these instructions, you can set up SSH as a server service in our Ubuntu systems to be able to connect remotely and securely to your computer in order to work with the command line and perform any required task.

Our other website, Linux Handbook, has various informational articles on SSH. From here, I recommend reading the following:

If you find it overwhelming, Linux Handbook has a premium video course that explains SSH for beginners along with hands-on labs to follow. This will give you a more streamlined knowledge of the topic.

Happy remote working!



from It's FOSS https://ift.tt/3vz8nGu
via IFTTT

Senin, 24 Mei 2021

Linux Jargon Buster: What are Daemons in Linux?

Daemons work hard so you don’t have to.

Imagine that you are writing an article, Web page, or book, Your intent is to do just that – write. It’s rather nice not having to manually start printer and network services and then monitor them all day to make sure that they are working right.

We can thank daemons for that – they do that kind of work for us.

What is a daemon in Linux?

What is a Daemon in Linux?

daemon (usually pronounced as: day-mon, but sometimes pronounced as to rhyme with diamond) is a program with a unique purpose. They are utility programs that run silently in the background to monitor and take care of certain subsystems to ensure that the operating system runs properly. A printer daemon monitors and takes care of printing services. A network daemon monitors and maintains network communications, and so on.

Having gone over the pronunciation of daemon, I’ll add that, if you want to pronounce it as demon, I won’t complain.

For those people coming to Linux from the Windows world, daemons are known as services. For Mac users, the term, services, has a different use. The Mac’s operating system is really UNIX, so it uses daemons. The term, services is used, but only to label software found under the Services menu.

Daemons perform certain actions at predefined times or in response to certain events. There are many daemons that run on a Linux system, each specifically designed to watch over its own little piece of the system, and because they are not under the direct control of a user, they are effectively invisible, but essential. Because daemons do the bulk of their work in the background, they can appear a little mysterious and so, perhaps difficult to identify them and what they actually do.

What Daemons are Running on Your Machine?

To identify a daemon, look for a process that ends with the letter d. It’s a general Linux rule that the names of daemons end this way.

There are many ways to catch a glimpse of a running daemon. They can be seen in process listings through pstop, or htop. These are useful programs in their own right – they have a specific purpose, but to see all of the daemons running on your machine, the pstree command will suit our discussion better.

The pstree command is a handy little utility that shows the processes currently running on your system and it show them in a tree diagram. Open up a terminal and type in this command:

pstree

You will see a complete listing of all of the processes that are running. You may not know what some of them are, or what they do, they are listed. The pstree output is a pretty good illustration as to what is going on with your machine. There’s a lot going on!

check for daemon with pstree
daemon – pstree run completed

Looking at the screen shot, a few daemons can be seen here: udisksd, gvfsd, systemd, logind and some others.

Our process list was long enough to where the listing couldn’t fit in a single terminal window, but we can scroll up using the mouse or cursor keys:

daemon pstree
daemon – top part of pstree

Spawning Daemons

demons
Picture for representational purpose only

Again, a daemon is a process that runs in the background and is usually out of the control of the user. It is said that a daemon has no controlling terminal.

process is a running program. At a particular instant of time, it can be either running, sleeping, or zombie (a process that completed its task, but waiting for its parent process to accept the return value).

In Linux, there are three types of processes: interactive, batch and daemon.

Interactive processes are those which are run by a user at the command line are called interactive processes.

Batch processes are processes that are not associated with the command line and are presented from a list of processes. Think of these as “groups of tasks”. These are best at times when the system usage is low. System backups, for example, are usually run at night since the daytime workers aren’t using the system. When I was a full-time system administrator, I often ran disk usage inventories, system behavior analysis scripts, and so on, at night.

Interactive processes and batch jobs are not daemons even though they can be run in the background and can do some monitoring work. They key is that these two types of processes involve human input through some sort of terminal control. Daemons do not need a person to start them up.

We know that a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. When the system boot is complete, the system initialization process starts spawning (creating) daemons through a method called forking, eliminating the need for a terminal (this is what is meant by no controlling terminal).

I will not go into the full details of process forking, but hopefully, I can be just brief enough to show a little background information to describe what is done. While there are other methods to create processes, traditionally, in Linux, the way to create a process is through making a copy of an existing process in order to create a child process. An exec system call to start another program in then performed.

The term, fork isn’t arbitrary, by the way. It gets its name from the C programming language. One of the libraries that C uses, is called the standard library, containing methods to perform operating services. One of these methods, called fork, is dedicated to creating new processes. The process that initiates a fork is considered to be the parent process of the newly created child process.

The process that creates daemons is the initialization (called init) process by forking its own process to create new ones. Done this way, the init process is the outright parent process.

There is another way to spawn a daemon and that is for another process to fork a child process and then die (a term often used in place of exit). When the parent dies, the child process becomes an orphan. When a child process is orphaned, it is adopted by the init process.

If you overhear discussions, or read online material, about daemons having “a parent process ID of 1,” this is why. Some daemons aren’t spawned at boot time, but are created later by another process which died, and init adopted it.

It is important that you do not confuse this with a zombie. Remember, a zombie is a child process that has finished its task and is waiting on the parent to accept the exit status.

Examples of Linux Daemons

linux daemon

Again, the most common way to identify a Linux daemon is to look for a service that ends with the letter d. Here are some examples of daemons that may be running on your system. You will be able to see that daemons are created to perform a specific set of tasks:

systemd – the main purpose of this daemon is to unify service configuration and behavior across Linux distributions.

rsyslogd – used to log system messages. This is a newer version of syslogd having several additional features. It supports logging on local systems as well as on remote systems.

udisksd – handles operations such as querying, mounting, unmounting, formatting, or detaching storage devices such as hard disks or USB thumb drives

logind – a tiny daemon that manages user logins and seats in various ways

httpd – the HTTP service manager. This is normally run with Web server software such as Apache.

sshd – Daemon responsible for managing the SSH service. This is used on virtually any server that accepts SSH connections.

ftpd – manages the FTP service – FTP or File Transfer Protocol is a commonly-used protocol for transferring files between computers; one act as a client, the other act as a server.

crond – the scheduler daemon for time-based actions such as software updates or system checks.

What is the origin of the word, daemon?

When I first started writing this article, I planned to only cover what a daemon is and leave it at that. I worked with UNIX before Linux appeared. Back then, I thought of a daemon as it was: a background process that performed system tasks. I really didn’t care how it got its name. With additional talk of other things, like zombies and orphans, I just figured that the creators of the operating system had a warped sense of humor (a lot like my own).

I always perform some research on every piece that I write and I was surprised to learn that apparently, a lot of other people did want to know how the word came to be and why.

The word has certainly generated a bit of curiosity and, after reading through several lively exchanges, I admit that I got curious too. Perform a search on the word’s meaning or etymology (the origin of words) and you’ll find several answers.

In the interest of contributing to the discussion, here’s my take on it.

The earliest form of the word, daemon, was spelled as daimon, a form of guardian angel – attendant spirits that helped form the character of people they assisted. Socrates claimed to have one that served him in a limited way, but correctly. Socrates’ daimon only told him when to keep his mouth shut. Socrates described his daimon during his trial in 399 BC, so the belief in daimons has been around for quite some time. Sometimes, the spelling of daimon is shown as daemon. Daimon and daemon, here, mean the same thing.

While a daemon is an attendant, a demon is an evil character from the Bible. The differences in spelling is intentional and was apparently decided upon in the 16th century. Daemons are the good guys, and demons are the bad ones.

The use of the word, daemon, in computing came about in 1963. Project MAC is shorthand for Project on Mathematics and Computation, and was created at the Massachusetts Institute of Technology. It was here that the word, daemon, came into common use to mean any system process that monitors other tasks and performs predetermined actions depending on their behavior, The word, daemon was named for Maxwell’s daemon.

Maxwell’s daemon is the result of a thought experiment. In 1871, James Clerk Maxwell imagined an intelligent and resourceful being that was able to observe and direct the travel of individual molecules in a specific direction. The purpose of the thought exercise was to show the possibility of contradicting the second law of thermodynamics.

I did see some comments that the word, daemon, was an acronym for Disk And Executive MONitor. The original users of the word, daemon, never used it for that purpose, so the acronym idea, I believe, is incorrect.

beastie

Lastly – to end this on a light note – there is the BSD mascot: a daemon that has the appearance of a demon. The BSD daemon was named after the software daemons, but gets is appearance from playing around with the word.

The daemon’s name is Beastie. I haven’t researched this fully (yet), but I did find one comment that states that Beastie comes from slurring the letters, BSD. Try it; I did. Say the letters as fast as you can and out comes a sound very much like beastie.

Beastie is often seen with a trident which is symbolic of a daemon’s forking of processes.



from It's FOSS https://ift.tt/3hRpGyw
via IFTTT

Minggu, 23 Mei 2021

Gromit-MPX Lets You Draw Anywhere On Linux Desktop Screen

Have you ever wished that you could freeze your Linux desktop screen and draw anything on it? Or, you may want to point out or highlight a part of your app or desktop to someone else while screen recording on Linux?

If so, Gromit-MPX is an easy-to-use on-screen annotation tool that you could use right now.

Make Annotation On Screen Using Gromit-MPX

gromit mpx
Gromit-MPX

Gromit-MPX (GRaphics Over MIscellaneous Things – Multi-Pointer EXtension) is a free and open-source tool that lets you annotate anywhere on the screen. The best thing about the app is it does not restrict you to use it only on one desktop environment.

Rather, Gromit-MPX is desktop-independent and supports all Unix-based desktop environments such as GNOME, KDE, and Xfce under both X11 and Wayland windowing sessions.

Even for X11, if you have a second pair of input devices and want to use it to annotate in place of the first pair, the app lets you set both a pointer for a dedicated annotation device and a multi-pointer at once.

Another thing that makes Gromit-MPX quite different from other available annotation tools is its easy-to-use and distraction-free philosophy.

What I mean to say is that, once you install and activate the app, you can either operate it using its tray icon (if your desktop has a system tray) or six default keys binding. Gromit-MPX does not draw or stick any UI widget of its own for making useful options available.

Tray icon options
Tray icon options

You can toggle it on and off on the fly using a F9 hotkey without interrupting your normal workflow. And whether you want to undo/redo your last draw or clear the screen completely, you’re only one key away from performing the action: F8 to undo the last stroke (max up to 4 stroke) and SHIFT-F9 to clear the screen.

gromit mpx available commands
Gromit-MPX Available Commands

Of course, you’re also completely free to change its default configuration for both key bindings and drawing tools.

One of the things that I think Gromit-MPX lacks is the availability of different shapes like rectangles, circles, and straight lines. Currently, you can annotate the desktop screen only using freehand drawing, which you may initially find difficult to handle.

upcoming feature in gromit mpx
Upcoming feature in Gromit-MPX

However, the good news is the functionality to draw straight lines in Gromit-MPX is under development and already planned to feature in the next version 1.5.

Installing Gromit-MPX on Ubuntu and other Linux distributions

If you’re using Debian-based distributions like Ubuntu, Gromit-MPX is already available in the repository. You only need to run a single command to install it.

sudo apt install gromit-mpx

However, for the older OS version, you may not get the latest version 1.4 of the app and miss some important features. If you want the current latest version 1.4, you need to install it from the Flathub repository using the universal package manager Flatpak.

If you’ve not set up Flatpak on your system, check out the complete Flatpak guide. Once you enable the Flatpak support, you can run the following command to install Gromit-MPX.

flatpak install flathub net.christianbeier.Gromit-MPX
install gromit mpx using flatpak
Install Gromit-MPX Using Flatpak

If you don’t want the Flatpak package or your system doesn’t support it, you can also download its source code, compile and build the app on its own.

How to change key binding and tool color in Gromit-MPX?

By default, Gromit-MPX uses red color for the tool. But it also provides other colors that you can switch to using hotkeys. For instance, once you toggle on drawing, you can hold SHIFT for turning tool color into blue, and CONTROL for yellow.

And if you wish your default color other than red or different color for different hotkeys, you can configure the same in the gromit-mpx.cfg file.

change tool color
Change tool color

You can find the configuration file either in a directory listed in $XDG_CONFIG_HOME variable (usually ~/.config or ~/.var/app/net.christianbeier.Gromit-MPX/config/ if you’ve installed Flatpak package) or /etc/gromit-mpx/ if you have Debian package.

For changing the default Hotkey or Undo key, you need to add a new entry with a custom value in the same config file.

HOTKEY="F9"
UNDOKEY="F8"

How to start Gromit-MPX automatically on boot?

In case you’re using Gromit-MPX regularly, then you may want to mark it as a startup app instead of opening it manually each time you boot the system.

So, to autostart Gromit-MPX, you can either make use of the GUI Startup Applications utility or manually add a desktop entry with the below content at ~/.config/autostart/gromit-mpx.desktop.

[Desktop Entry]
Type=Application
Exec=gromit-mpx

If you’re using the Flatpak package, you need to replace Exec=gromit-mpx with Exec=flatpak run net.christianbeier.Gromit-MPX.

I hope you like this nifty tool. If you try it, don’t forget to share your experience.



from It's FOSS https://ift.tt/34btOS0
via IFTTT

How to Install and Use XRDP on Ubuntu for Remote Desktop Connection

Brief: This is a beginner’s guide that shows the steps you need to follow for setting up XRDP on Ubuntu-based Linux distributions. With this, you can access your Ubuntu system from a different computer and use it graphically.

Microsoft Remote Desktop Protocol(RDP) is a protocol that allows for graphical remote desktop connections from one computer to another. RDP works by having a main machine run software that allows several other computers to connect to it.

XRDP is an open-source implementation of RDP, removing the need to run any proprietary programs. XRDP not only tries to follow in the direction of RDP, but is also compatible with regular RDP clients such as Remmina and GNOME Boxes.

Here’s what the XRDP connection screen looks like.

xrdp connected login

Things to keep in mind about using XRDP

While XRDP works great for getting remote access to machine, it’s important to know what XRDP isn’t good at.

Do not use XRDP if you need a secure connection

Connections made over XRDP can be viewed and modified by attackers, and should thus be avoided for any sensitive information. This can be alleviated through the use of an SSH connection or certificates, but both require a more complex setup and won’t be covered here.

XRDP doesn’t work well with theming by default

In my testing, XRDP didn’t ever seem to apply the theming Ubuntu comes with by default. Instructions for fixing this are available at the end of the article.

You need a desktop environment installed on the remote computer

You’ll need a graphical environment installed on the machine everything will connect to for any of this to work. If you are using a desktop Linux to be accessed remotely, it’s all good.

But if you are using a server operating system, it won’t work. Of course, you can install GUI on your Ubuntu server but you’ll be a lot better using SSH to use the remote system via command line.

Using XRDP to connect to a Ubuntu Linux system remotely

Here’s the setup you need for this remote connection setup to work properly.

  • A Linux system with XRDP server installed on it. This is the system which will be accessed remotely.
  • The remote system should either be on the same network as yours or it should have a public IP address.
  • You need to know the username and password of the remote Linux system, obviously.
  • Another system (be it Linux or Windows) with an XRDP client.
xrdp ubuntu

The process is really simple. Let’s see it in steps.

Step 1: Install XRDP on the ‘remote computer’

I am calling it remote computer for reference only. Of course, you need to have access to it in the first place for installing the XRDP package.

XRDP is included in the repositories of most distributions. On Ubuntu, you can find it in the universe repository and install it using this command:

sudo apt install xrdp

Step 2: Get the IP address of the ‘remote computer’

You’ll need the IP address of the remote system in order to connect to it. You can get the IP address in Linux using the ip command:

ip address

As you can see, the system in the example has IP address 192.168.0.107. This is on the subnet, of course.

abhishek@its-foss:~$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether dc:46:b9:fb:7a:c5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.107/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp0s20f3
       valid_lft 6183sec preferred_lft 6183sec

Step 3: Connecting to a XRDP machine from ‘local computer’

The good news is that XRDP works right out of the box!

To connect to the machine you installed XRDP on, you’ll first need to install an RDP client on your local system (from where you are trying to connect to the remote system).

I’ll be using GNOME Boxes in this tutorial, which can be installed with the following:

sudo apt install gnome-boxes

GNOME Boxes is primarily used for virtual machines but it is also a good XRDP client. You may use other tools like Remmina.

Start the GNOME Boxes application. Click on the + sign and select “Connect to a Remote Computer…“.

xrdp gnome boxes connect begin

Next, enter the IP address of the machine you’re connecting to, prefixed with rdp://, and then connect as shown below:

xrdp gnome boxes rdp connect

In the above example, I deployed an Ubuntu server on Linode cloud server. I also installed GNOME desktop on it. This server has a public IP address that can be accessed from anywhere. I have used the public IP address.

You should then be presented with a login screen. Keep “Session” set to “Xorg”, and just enter your username and password, then click “OK”:

xrdp connected login

After, you should be presented with your desktop:

xrdp connected homescreen

And now you’re good to go! Everything will (mostly – more on that below) behave just the same as if the machine was right in front of you.

Troublehsooting: Fixing theming issues with XRDP connection

In my testing on Ubuntu 20.04, the default Yaru theme didn’t seem to apply by default when connecting over. This can be fixed with some effort.

First, run this command on the remote computer:

sudo apt install gnome-tweaks gnome-shell-extensions dconf-editor -y

Next, open the Extensions app, and turn on the toggles shown below:

xrdp extensions

Next, close your remote desktop session and log back in. Now, open up Tweaks and configure everything per the screenshot below:

xrdp tweaks

Lastly, open up dconf Editor, and navigate to /org/gnome/shell/extensions/dash-to-dock/. Set the values that are shown below:

  • custom-theme-shrink: On
  • dock-fixed: On
  • transparency-mode: FIXED

And there you go, everything is good to go!

Wrapping up

This should help you get started with XRDP on Ubuntu and other Linux systems. This is a convenient tool for connecting to remote systems, specially on the same network.

If something didn’t work quite right, or you just have any questions or comments, feel free to leave them below. I’ll try to help you out.



from It's FOSS https://ift.tt/3faCCxr
via IFTTT