Top 5 tools to Remote Access in Linux

In this tutorial, I will display you tools that permit you to get right of entry to faraway Desktop on machines strolling CentOS/RHEL. All those apps work in client-server mode. So you want to run a server-aspect app for your faraway machine and after that, you may be capin a position to connect to it from everywhere in the world. Of course on this reference manual, I will inform you a way to configure this securely, so most effective you could get right of entry to your server. Before we begin, you’ll want SSH access on your server and permissions to put in the software. You will want to login as the root user or user with the sudo privileges. All instructions will work on each CentOS server 5/6/7/8. Before we start, you want to put in desktop surroundings on your server.

1) VNC

x11vnc – simplest of these three methods to get remote access. VNC stands for Virtual Network Computing) is a very useful network graphics protocol.

You need to enable EPEL (Extra Packages for Enterprise Linux) repository. Run

# yum -y install epel-release

Now we can install x11vnc. This command will install server and solve all dependencies:

# yum -y install x11vnc

Then we will protect server with password:

# x11vnc -storepasswd

Enter VNC password:

Verify password:

Write password to /root/.vnc/passwd? [y]/n y

Password written to: /root/.vnc/passwd

!Do not use simple passwords!

We are now ready to start server:

# x11vnc --reopen --forever -rfbauth ~/.vncpasswd &

You can check if servers started:

# netstat -an | grep 5900

tcp 0 0* LISTEN

tcp6 0 0 :::5900 :::* LISTEN

If it is ok, simply try to connect to it using vncviewer.

# yum -y install vnc
# vncviewer YOUR_SERVER_IP

That’s all! Now you have access to your desktop. After reboot just ssh again and do it again.

x11vnc --reopen --forever -rfbauth ~/.vnc/passwd &

2) TigerVNC server

TigerVNC – is a high-performance, platform-neutral implementation of VNC

# yum install -y tigervnc-server

Let’s copy example config and edit it:

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
# vi /etc/systemd/system/vncserver@:1.service

Example of config:

Description=Remote desktop service (VNC)


# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l USERNAME -c "/usr/bin/vncserver %i"
ExecStop=/usr/sbin/runuser USERNAME -c '/usr/bin/vncserver -kill %i'


NOTE: You must change the USERNAME in the above config if you’ll use the same VNC setup. This is the configuration we used for this tutorial.

Now we must run vncpasswd command to setup our access password, and/or view-only password (a password that allows the user to only view the remote screen):

# vncpasswd 
Would you like to enter a view-only password (y/n)? n
A view-only password is not used

Now enable autostart service and restart it:

$ systemctl enable vncserver@:1.service
$ systemctl restart vncserver@:1.service

You can check the vnc service status by typing:

$ systemctl status vncserver@:1.service

If everything went ok, you should have similar terminal output to this:

$ systemctl status vncserver@:1.service
● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
   Active: active (exited) since Wed 2020-09-30 22:04:47 CEST; 7s ago
  Process: 3766 ExecStart=/usr/sbin/runuser -l slax -c /usr/bin/vncserver %i (code=exited, status=0/SUCCESS)
  Process: 3761 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 3766 (code=exited, status=0/SUCCESS)

Sep 30 22:04:44 localhost.localdomain systemd[1]: Starting Remote desktop service (VNC)...
Sep 30 22:04:47 localhost.localdomain systemd[1]: Started Remote desktop service (VNC).

And finally connect to it:

# vncviewer YOUR_SERVER_IP


XRDP is an Open Source Remote desktop Protocol server. In order to use XRDP you need to have VNC service already installed. So you should follow the first or second option from this tutorial prior to XRDP installation.

First of all we need to install EPEL repository and xrdp server:

# yum -y install epel-release
# yum -y install xrdp

Now let’s start service:

# systemctl start xrdp.service 

Check if its running, and add it to autostart.

# netstat -an | grep 3389 
tcp 0 0* LISTEN
# systemctl enable xrdp.service

Thats all. Now you can connect to your server from any Windows machine.

4) Teamviewer

Teamviewer does not exist in standard repos, so we need to install wget and download TeamViewer rpm package

# yum -y install wget
# wget

Install it using this command:

# yum install teamviewer.x86_64.rpm

And set your password:

# teamviewer passwd YOUR_PASSWORD
# systemctl start teamviewerd.service

Now you only need to get your id to connect:

# teamviewer –info
TeamViewer ID: 9XXXXXXX7

Try to connect to it using this id and password you set before:

5) FreeNX

FreeNX is a Remote Access solution based on enterprise-class open source technologies by NoMachine. If you want exactly this tool to get remote access, you may consider upgrading to cloud version.

First of all we need to add e EPEL + nux-dextop repositories, for Centos 6:

# rpm -Uvh
# rpm -Uvh

For Centos 7

# rpm -Uvh
# rpm -Uvh

Install server and agent:

# yum install freenx-server nxagent 

Enable passdb authentication:

# echo 'ENABLE_PASSDB_AUTHENTICATION="1"' >> /etc/nxserver/node.conf

Now we need to create user for remote access and assign password for him:

# /usr/libexec/nx/nxserver --adduser bob 
NX> 100 NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: not detected)
NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: not detected)
NX> 716 Public key added to: /home/bob/.ssh/authorized_keys2
NX> 1001 Bye.
NX> 999 Bye

#/usr/libexec/nx/nxserver --passwd bob 
NX> 100 NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: not detected)
New password:
Password changed.
NX> 999 Bye

Now we will install epel-repos and opennx client on your machine:

# yum install opennx

After beginning opennx wizard you’ll be requested approximately the consultation name, server address, and port. Most essential component is to installation your key. You’ll want to replicate the important thing from server’s /etc/nxserver/client.id_dsa.key and paste it into the overall tab of your client session properties. Please share your remarks in this educational and allow us to recognise in case you are privy to some other tools.


rdp linux, xrdp ubuntu, linux remote desktop client, remote access in linux, linux rdp client, gnome remote desktop, linux rdp server

How to Setup Cron Job on Linux with Examples

Crontab record shops the cron jobs in Linux. Cron jobs (cron) runs periodically at constant time, dates and intervals. Its equal in Windows is scheduled task. All repetitive responsibilities may be scheduled the use of cron. Crontab record is the configuration record which includes records approximately the time and command/scripts to execute. In this educational we examine Linux crontab with examples to time table jobs. Crontab Syntax Each line in crontab record represents a job. It incorporates 5 fields accompanied via way of means of a shell command or script to execute.


* (Minute) *(Hour) * (Day of the Month) *(Month of the Year) *(Day of the Week) username <path to command/script to execute
*MinuteThis field value is between 0 – 59
*HourThis field value is between 0 – 23
*Day of the monthThis field value is between 1 – 31
*Month of the yearThis field value is between 1 – 12. First 3 alphabet of month is also accepted like jan, feb, mar
*Day of the weekThis field value is between 0 – 7. Where 0 and 7 is Sunday. 1 is Monday, 2 is Tuesday , like wise

Define multiple values or ranges

To define multiple values and ranges use comma (,) and hyphen (-). The asterisk (*) matches anything. For example, to show multiple values use 1,2,3 or mon,tue,wed and for ranges can use 1-3 or mon-wed.

How to use crotab

crontab command is used to open and edit/add cron jobs. The cron daemon that run on Linux execute scheduled jobs at time define in the crontab ( cron table). The main system-wide crontab file is /etc/crontab.

Cron is by default installed in most Linux Distributions. Each user in the Linux system can manage their own cron jobs. Each user cron is stored under /var/spool/cron/crontabs/. The cron daemon runs both user and system crontab.

Cron daemon has some default $PATH defined, which you can find in /etc/crontab. If its not define either use absolute path or add to the cron $PATH variable.

Cron mail notification by default is sent to owner of the crontab. To change this, edit MAILTO environment variable.

Cron logs are stored in /var/log/syslog on Ubuntu/Debian systems and in /var/log/cron on Redhat/Rocky Linux. You can filter the log file using grep command to verify the cron job ran successfully or not.

1. Edit/add Crontab

To edit (existing jobs) or add new cron use crontab -e command. This will open an editor for the current user.

$ crontab -e

To edit another user crontab file, type:

$ crotab -u username -e

Or simply run crontab -e command by logged in as that user.

2. List Cron Jobs

To list all jobs of the current user, type:

$ crontab -l

To list all cron jobs for a specified user, type:

$ crontab -u -l 

3. Remove cron jobs

To remove all cron jobs of the current user, execute the following command:

# crontab -r

Note: This will remove all the cron jobs without asking for confirmation.

If you want to delete interactively, you need to use the following command:

# crontab -ir

Crontab Jobs Examples

Let’s check some crontab examples for scheduling cron jobs.

1. Run cron jobs every 12 hours

This helps for regular system checks or backups. To schedule a task to run every 12 hours, type:

0 */12 * * * /scripts/

2. Run cron job every 5 minutes

Sometimes you need to monitor your system every n minutes. Use the following expression to run the task every 5 minutes.

*/5 * * * * /scripts/

3. Run cron job every day at 2 am

Everyday backup can be scheduled for a specific time. The following expression runs the cron job at 2 am every day.

0 2 * * * /script/

To schedule a cron job every day at 2 pm, cron use 24 hours clock.

0 14 * * * /script/

4. Run cron job every day at 12:30 am

30 12 * * * /script/

5. Run cron job every minute

For example, you have a script that needs to be run every minute, use the following expression.

* * * * * /scripts/

6. Run cron job at certain minutes

Use the following cron expression to run the script at minutes 2, 15, and 30.

2,15,30 * * * * /scripts/

7. Run cron job to run every Saturday at 1 AM

This helps you nee to run the backup on Saturday at a specific time. The following expression helps to cron job on every Saturday at 1 AM.

0 1 * * sat /scripts/

8. Run cron job to run on specific Months

To run cron jobs at 01:00 on the 1st day of the month on January, April, and June.

0 1 1 jan,apr,jun *  /script/ 

9. Run cron job on selected days

To run cron jobs on selected days such as Saturday and Sunday, use:

0 4 * * sat,sun  /script/

10. Run cron jobs at certain hours of the day

At minute 0 past every hour from 9 through 17

0 9-17 * * * /script/

11. Run cron job twice on every Saturday and Sunday

Cron jobs allow running tasks on specific hours on specific days

0 2,23 * * sat,sun /scripts/

12. Run cron job for a range of Monday to Friday

At 02:00 on every day-of-week from Monday through Friday.

0 2 * * mon-fri /scripts/

13. Run cron job monthly

Instead of using 0 0 1 * *, you can use shortcut using @monthly. It runs at 00:00 on the 1st day of month. Alternatively you can place your script under /etc/cron.monthly/.

@monthly /scripts/

14. Run cron job weekly

Instead of using 0 0 * * mon, you can use shortcut using @weekly. It runs at 00:00 on Monday. Alternatively you can place your script under /etc/cron.weekly/.

@weekly /scripts/

15. Run cron job daily

Instead of using 0 0 * * *, you can use shortcut using @daily. It runs at 00:00 every day. Alternatively you can place your script under /etc/cron.daily/.

@daily /scripts/

16. Run cron job hourly

Instead of using 0 */1 * * *, you can use shortcut using @hourly. It runs at 0 minutes past every hour. Alternatively you can place your script under /etc/cron.hourly/.

@hourly /scripts/

17. Run cron job on reboot

To run a task at every system reboot use @reboot string. The script will execute after rebooting.

@reboot /scripts/

18. Run cron job every 30 seconds

Cron only allows to run for a minimum of 60 seconds. There is no straightforward method to schedule a job to run every 30 seconds.

But we can use a work around by increasing the delay by 30 seconds.

 * * * * /scripts/
 * * * *  sleep 30; /scripts/ 

19. Run a cron job and redirect the output

This will run the php script every 3 minutes and redirect the output to a file.

*/3 * * * * /usr/bin/php /script/run.php >> /var/log/run.log

20. Run cron job to execute multiple commands

To run cron to execute multiple commands, use the operator && between the commands.

0 */12 * * Sun command1 && command2

Backup cron jobs

To backup cron, use the following command

# crontab -l > /backup/cron/root-bckup

To backup cron of a specific user, type:

# crontab -u userName -l > /backup/cron/user-bckup.txt

To restore cron from the backup file, simple use:

# crontab /backup/cron/root-backup.txt


In this tutorial we learned about crontab in Linux and examples to schedule cron jobs.

If you have any feedback and suggestion please comment below.


cronjob, cron job schedule, cron every 5 minutes, crontab in linux, cron job syntax, crontab example, cron every minute, cron run every hour

How to setup Munin monitoring system in CentOs

Hello Everybody! Welcome to our today’s article on one the maximum extensively used, freed from fee and Open Source Munin Network Resource Monitoring System. Its a perl software program utility assist you to tracking your every and each asset that continues document of it and sends you the important signals of offerings on your servers, switches, applications, and any every other gadgets linked on your community whether or not its your computers, community, garage or the entire IT infrastructure. It suggests all of the data in graphs via an internet interface that emphasis on plug and play capabilities. Munin has a grasp/node structure wherein the grasp connects to all of the nodes at ordinary durations and asks them for data, then stores the data in RRD documents to updates the graphs if needed. So, after finishing its set up a excessive wide variety of tracking plugins could be playing without a greater effort.


Your structures hardware assets depends upon your very own necessities at the same time as in this newsletter we are able to be the use of the subsequent device aid for Munin set up on CentOS 7.

System Resources
Munin VersionMunin 2.0.25
Base OSCentOS Linux 7 (Core), 64-bit
Hard Disk30 G

Munin set up setup calls for the fundamental net server applications to be established at the server. So, after fundamental networking setup configure your hostname, IP deal with and firewall settings through preserving SELinux into permissive mode. Then begin putting in applications through replace your system first and permitting EPEL repository on it the usage of under commands.

# yum install epel-release
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
# yum update

You may be requested to press “Y” key and hit Enter to continue for putting in all required updates. Once the updates are efficiently hooked up to your machine then continue to the set up of Apache Web server.

Setup Apache Web Server

To setup your Apache net server, we want to begin with the aid of using putting in its bundle the use of the below ‘yum’ command.

# yum install httpd

Upon of of entirety of programs installation, begin and allow its carrier and test that its lively and enabled the usage of the subsequent instructions respectively.

# systemctl enable httpd
# systemctl start httpd
# systemctl status httpd

Installing Munin monitoring system

We can set up Munin and Munin Node the use of the below ‘yum’ command via its to be had repository on CentOS 7 as shown.

# yum install munin munin-node

Hit “Y” plus Enter key to begin set up of Munin and Munin Noe consisting of a big range its required dependencies. Once the set up is complete, begin its service and permit it at auto begin throughout reboot with the aid of using the use of the subsequent commands.

Configure Munin

Now configure Munin via way of means of open its default configuration the use of any editor as utilized in beneath command.

# vim /etc/munin/munin.conf

# a simple host tree, change localhost with your FQDN.

use_node_name yes

After saving the Munin configuration document, Open its apache digital host configuration document to feature get admission to permissions on your network.

# vim /etc/httpd/conf.d/munin.conf

After saving the configuration record changes , restart apache internet server service the usage of command below.

# systemctl restart httpd

Now we’re going to upload a brand new person and password to the /etc/munin/munin-htpasswd record because the Munin facts are included with a username and password, so we want to setup the simple Apache Authentication.

# htpasswd -c /etc/munin/munin-htpasswd admin

This will upload a brand new person with the name “admin” and asks for the brand new password as shown.

# vi /etc/munin/munin-node.conf


Save and near the report and restart munin-node offerings and get admission to the subsequent hyperlink via way of means of mentioning your FQDN or IP from the customer that is for your community that changed into allowed in configuration report. http://your_servers_IP/munin

Welcome to Munin Web Console

Here is the Munin dashboard, now you can check the graphs of your required servers.

We can customise Munin dashboard via way of means of including one of a kind to be had plugins and upload more than one node to it. While the use of its internet console we’ve got alternatives to create more than one companies and classes consistent with the desired organization of services. You can test and notice the popularity of your vital provider via way of means of establishing its graph from the Munin internet console with a purpose to display you the modern and beyond facts from its maintained hostory as proven in beneath image.


Munin installation has been setup. We desire you’ve got got loved studying this article. The set up of Munin is pretty simple, now in reality upload the purchaser node and begin tracking your entire IT infrastructure the usage of this superb device without paying any charges. Now revel in the usage of Munin in your surroundings and sense unfastened to proportion your mind or tips in comments section.


munin, munin linux, munin ubuntu, munin github, munin cron, munin mysql, munin apache, munin centos 7, munin centos 8, centos munin, munin ping, munin node centos

How to setup PhpPgAdmin in CentOS

PostgreSQL is an open-supply relational database control system that has helped to form the sector of software improvement with advanced, SQL-compliant. The fundamental gain of the use of PostgreSQL is that it calls for very minimal preservation efforts due to its stability. The programs primarily based totally on PostgreSQL have a low value of possession in assessment with different database control systems. It’s designed to be extensible in a manner that you could outline your very own records types, index types, functional languages, etc. PhpPgAdmin is a web-primarily based totally GUI software that makes it easy for administering your PostgreSQL databases. phpPgAdmin will allow you to add, cast off and manipulate databases, tables, and entries; run particular SQL queries, backup the database, search and import record, and lots more. In this educational we discover ways to deploy phpPgAdmin on CentOS 7.


Before beginning the set up of PotgreSQL and phpPgAdmin ensure which you have root get entry to in your CentOS server and your are linked to the internet for downloading the packages. After login in your server, run the command under to replace your centos 7 server with the state-of-the-art patches.

# yum update

If you going to install PostgreSQL and phpPgAdmin on a production surroundings with firewall and SELinux enabled, then ensure to permit the subsequent default ports in order to be used for postgreSQL and apache.

# firewall-cmd --permanent --add-port=5432/tcp
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --reload
# setsebool -P httpd_can_network_connect_db 1

Let’s begin the Installation

By default Centos 7 comes with PostgreSQL Version 9.2.1 that may be set up with the aid of using the usage of the easy yum command whilst the contemporary latest PostgreSQL Version is 9.4.5. So, on this tutorial, we are able to be putting in the latest model of PostgreSQL by the usage of the PostgreSQL Yum Repository. To get the latest yum repository for the latest PostgreSQL package deal open the PostgreSQL Download Page or copy the hyperlink and run the under wget command.

# wget

Now install the rpm file with below commands

# rpm -i pgdg-redhat94-9.4-1.noarch.rpm
# yum install postgresql94-server postgresql94-contrib

After jogging the above command there might be variety of the subsequent package might be established consisting of few dependencies. To continue the set up technique press the “Y” key to maintain as shown.

Dependencies Resolved
Package Arch Version Repository Size
postgresql94-contrib x86_64 9.4.5-1PGDG.rhel7 pgdg94 610 k
postgresql94-server x86_64 9.4.5-1PGDG.rhel7 pgdg94 3.8 M
Installing for dependencies:
libxslt x86_64 1.1.28-5.el7 base 242 k
postgresql94 x86_64 9.4.5-1PGDG.rhel7 pgdg94 1.0 M
postgresql94-libs x86_64 9.4.5-1PGDG.rhel7 pgdg94 209 k

Transaction Summary
Install 2 Packages (+3 Dependent packages)

Total download size: 5.9 M
Installed size: 25 M
Is this ok [y/d/N]: y

run the below command to initialize the database

# /usr/pgsql-9.4/bin/postgresql94-setup initdb
Initializing database ... OK

Start the Database service

To begin the PostgreSQL provider and to configure it for auto-permit at boot up run the subsequent commands after which test the status, it must be up and enabled.

# systemctl start postgresql-9.4
# systemctl enable postgresql-9.4

Now install the phpPgAdmin

Run the below command to install phpPgAdmin and http

yum install phpPgAdmin httpd

Type Y to install the required packages

Dependencies Resolved
Package Arch Version Repository Size
httpd x86_64 2.4.6-31.el7.centos.1 updates 2.7 M
phpPgAdmin noarch 5.1-2.rhel7 pgdg94 658 k
Installing for dependencies:
apr x86_64 1.4.8-3.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
httpd-tools x86_64 2.4.6-31.el7.centos.1 updates 79 k
libzip x86_64 0.10.1-8.el7 base 48 k
mailcap noarch 2.1.41-2.el7 base 31 k
php x86_64 5.4.16-36.el7_1 updates 1.4 M
php-cli x86_64 5.4.16-36.el7_1 updates 2.7 M
php-common x86_64 5.4.16-36.el7_1 updates 563 k
php-pdo x86_64 5.4.16-36.el7_1 updates 97 k
php-pgsql x86_64 5.4.16-36.el7_1 updates 84 k

Transaction Summary
Install 2 Packages (+10 Dependent packages)

Total download size: 8.5 M
Installed size: 30 M
Is this ok [y/d/N]:y

Configure PhpPgAdmin

Now don’t think too much and do as I say. But be careful if you are on production server

# vim /etc/httpd/conf.d/phpPgAdmin.conf
# vim /var/lib/pgsql/9.4/data/pg_hba.conf
# vim /var/lib/pgsql/9.4/data/postgresql.conf
# vim /etc/phpPgAdmin/
// Hostname or IP address for server. Use '' for UNIX domain socket.
// use 'localhost' for TCP/IP connection on this computer
$conf['servers'][0]['host'] = 'localhost';

// Database port on server (5432 is the PostgreSQL default)
$conf['servers'][0]['port'] = 5432;

$conf['owned_only'] = true;

Now restart the both services

# systemctl restart postgresql-9.4
# systemctl restart httpd

Access the web console

Let’s open the below URL to access the phpPgAdmin console as shown below.


Now login with your DB and password…


At the stop of this text, you discovered approximately the set up and configuration of PostgreSQL with phpPgAdmin on CentOS 7. Still, this changed into step one with inside the international of PostgreSQL as there are a variety of functions upon them you need to paintings on because it has a variety of tremendous functions like factor in time recovery, tablespaces, asynchronous replication, Multi-Version Concurrency Control (MVCC), and write-in advance logging for fault tolerance. So, we are hoping you discover this text a good deal beneficial so that you can begin database management with PostgreSQL.


phppgadmin, php pg admin, phppgadmin centos, postgresql phppgadmin, postgresql, postgresql centos,