It is important to keep your Linux server up to date with security updates, Linux Distributions like Ubuntu and Debian release updates daily, so it can become a tedious job to keep the system up to date. Thankfully there is an option to install security updates automatically, here are the steps to enable automatic security updates in Ubuntu 14.04 and later versions. Continue reading How to enable auto updates in Ubuntu
FFmpeg has been removed from Ubuntu 14.04 and was replaced by Libav. This decision has been reversed so that FFmpeg is available now in Ubuntu 15.04 again, but there is still no official package for 14.04. In this tutorial, I will show you how to install FFmpeg from mc3man ppa. Add the mc3man ppa:
sudo add-apt-repository ppa:mc3man/trusty-media
And confirm the following message by pressing <enter>:
Also note that with apt-get a sudo apt-get dist-upgrade is needed for initial setup & with some package upgrades More info: https://launchpad.net/~mc3man/+archive/ubuntu/trusty-media Press [ENTER] to continue or ctrl-c to cancel adding it
Update the package list.
sudo apt-get update sudo apt-get dist-upgrade
Now FFmpeg is available to be installed with apt:
sudo apt-get install ffmpeg
Follow these steps to disable IPv6 on CentOS. Edit the /etc/sysctl.conf file, I will use the nano editor here:
And add the following line at the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1
to load the new settings.
The next step is to edit the network card configuration file (/etc/sysconfig/network-scripts/ifcfg-eth*) and add or edit the setting IPV6INIT so that it is set to "no".
Now edit the file /etc/sysconfig/network:
And set the NETWORKING_IPV6 option to "no":
Then restart the server.
Jailkit is an easy to use tool to create and maintain jail environments for shell users on Linux. In this guide, I will show you how to move PHP and its dependencies into the jail so that the jailed user can execute PHP scripts inside the jail.
Continue reading How to add PHP support for jailed SSH users in ISPConfig 3
The bash history is a log file that contains all commands that the user executed on the Linux shell. When you use the "arrow up" key on our keyboard, then Bash will look up the previous command from that file and display it on the screen, ready to be executed again.
OpenVZ is a Linux based Kernel virtualization technology developed by SWSoft for its commercial product Virtuozzo. The modified Linux Kernel and the system utilities are released under an OpenSource license. Vzdump is a shell based backup program for OpenVZ virtual machines. It is made for containers that use the traditional "simfs" filesystem, it can not be used for containers with "ploop" filesystem.
Centos 7 replaced the traditional IPTables Linux Kernel Firewall with the Firewalld service. There are still a lot of scripts available that require the use of IPTables. A common example is the software Fail2ban.
In this guide, I will explain the installation of IPTables on Centos 7.x
The first step is to stop and mask the firewalld service:
systemctl stop firewalld systemctl mask firewalld
Then install the "iptables-services" package with the yum package installer:
yum install iptables-services
And enable the new service:
systemctl enable iptables
IPTables is now ready to be used on your server. For example you can block an external IP address now with the iptables command:
iptables -A INPUT -s 192.168.0.10 -j DROP
Rules that you set with iptables persist only until the next reboot. To save them permanently use the following command:
service iptables save
To get a list of all installed packages on a Debian or Ubuntu server, run the command:
This command will show you a rather long list. To save the list to a file, use this command:
dpkg --get-selections > /tmp/packages.txt
the list is saved then in the file /tmp/packages.txt.
If you seek for a specific package, use the grep command:
dpkg --get-selections | grep nginx
will show you all packages that contain the word "Nginx" in their name.
root@sv1:/# dpkg --get-selections | grep nginx nginx-common install nginx-extras install
The easiest way to change the hostname on CentOS 7 is to use the hostnamectl command.
First I will check the current hostname by running "hostnamectl status" on the shell of my server:
The output on my system is:
[root@server1 ~]# hostnamectl status Static hostname: server1.example.com Icon name: computer-vm Chassis: vm Machine ID: d89865d34b5a4637a9a4ff0ce0f6da02 Boot ID: 56d1685056d743b39e57a7b9cbfe467c Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64
Then I change the hostname with the set-hostname option of the hostnamectl command to server2.example.com
hostnamectl set-hostname server2.example.com
Afterward, I check with the command hostname and hostname -f if the hostname change has succeeded.
The result should be:
[root@server1 ~]# hostname server2.example.com [root@server1 ~]# hostname -f server2.example.com
Instead of the hostname command you could also use the "hostnamectl status" command again to check if the new hostname has been set:
[root@server1 ~]# hostnamectl status Static hostname: server2.example.com Icon name: computer-vm Chassis: vm Machine ID: d89865d34b5a4637a9a4ff0ce0f6da02 Boot ID: 56d1685056d743b39e57a7b9cbfe467c Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-123.el7.x86_64 Architecture: x86_64
The Following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System.
sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases
mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases
The benefit of the above command is that it uses the debian-sys-maint login to MySQL which is available on every Debian and Ubuntu System, so you don't have to provide the MySQL root login details.