Introduction
Gnome is a popular free and open-source desktop environment widely used on Linux operating systems. Originally developed in 1997 for Unix-based systems, Gnome continues to receive regular updates and improvements from a dedicated community of developers. In this guide, you will learn how to install and configure the Gnome desktop environment on your Linux server, enabling a user-friendly graphical interface for easier system management and remote access.
You can create a server in Serverspace with pre-installed operation system Linux Oracle.
Getting started
I'm pre-logged on the server, I enter privileged mode, so that I don't have to run commands through "sudo" every time.
Before installing a graphical shell on your server, update your programs by typing the command.
After refresh programs, install GUI on machine.
The installation could take up to 15 minutes.
After installing GUI, change default settings as a graphical shell.
To accept changes reload your machine.
Configure the configuration file
After restarting machine we have to edit the parameter in the config file using a text editor of your choice.
Installing GUI server
Install the required packages.
After setup the VNC server, we should create password for remote connection.
At this command, you can create pass only for viewing remote screen, create if u need.
This way the user has no rights to access the server but has rights to view the operation screen.
Configuring GUI
To connect remotely via VNC you must first specify which users are allowed to connect by entering the username in the configuration file.
Modify the config file with a text editor.
I give access for my profile, you could change for your username.
Note: Don't forget to save the configuration file before quitting!
You have an option to change your resolution of remote connection.
Modify the argument file.
The parameter "geometry" is responsible for the screen resolution of the remote desktop.
Also in this configuration file you can change the name of the session, I changed it to "serverspace" for the test.
Reboot the system configuration files.
Launch and test
Start your GUI server with using port as we choose.
To check the status of our GUI server we need to run the command
As we can notice Xvnc is listening 5901-port which sows that it is up and running.
I will demonstrate the connection using the program "VNC Viewer".
Specify the IP address of your server + the port you specified when you started the VNC server.
Use new created password for remote access, if you enter a "view only" that you cant change server settings.
After you connect to vnc, you have to enter the password of the user you are connecting with, in my publication the password is the root user.
The optional security features
VNC sends the traffic unencrypted and this only makes you less secure because if the traffic is not secure the intruder can use this against you by intercepting the connection and get hold of certain data.
To avoid this, you can protect yourself by creating a unique connection and giving instead of our ip address, the name of the local machine, so the attacker will not know the ip address of the server we connect to.
The whole connection process will be done under Windows 10.
Since I use ssh authentication via keys I previously created them on my computer using the command.
Created openssh key "SshKey" which will be located in the directory "C:\" to connect to the server remotely.
Specify the created public key in the configuration file of the allowed clients to connect.
Create a unique connection using "powershell".
After unique connection, open the VNC client and specify localhost:port instead of the ip of the server.
After that login the same way you did before, using the created VNC password.
The connection is now successful!
Output
At this publication I show you how to install, start and configure your VNC remote connect server, and how you can secure it.
Besides the vnc server, there is an alternative in the form of "xrdp" which allows you to use the Windows "rdp" protocol to connect to Linux servers.
FAQ
- Q: Why install the GNOME graphical interface on a server?
A: A graphical interface makes it easier to work with the server, especially for users who are not familiar with the command line. GNOME provides a convenient visual environment, and with VNC you can remotely access the server with a full desktop experience. - Q: Can I use a remote access protocol other than VNC?
A: Yes, an alternative to VNC is xrdp, which allows you to connect to a Linux server using the standard Windows Remote Desktop (RDP) client. It can be more convenient in some scenarios. - Q: How secure is it to use VNC for remote access?
A: By default, VNC transmits data unencrypted, which can be risky. It is recommended to tunnel VNC connections through SSH to encrypt the traffic and improve security. - Q: Do I need to create a separate password for VNC?
A: Yes, the vncpasswd command lets you set a password for accessing the remote desktop. You can also set a view-only password to limit user permissions. - Q: How do I change the resolution of the remote desktop?
A: You can change the geometry parameter in the /etc/tigervnc/vncserver-config-defaults configuration file to set the desired screen resolution for VNC connections. - Q: Do I need to change default settings after installing the graphical interface?
A: Yes, to make the server boot into graphical mode by default, run the command systemctl set-default graphical and then reboot the system.