November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

CentOS & yum-cron: Automatic reboot after kernel update

If you’re using yum-cron and want to automatically reboot your CentOS box whenever the kernel gets updated you can add this code to /etc/cron.daily/0yum.cron right before exit 0 at the end:

entry=`cat /boot/grub/grub.conf | grep ‘^default’ | cut -d ‘=’ -f2` entry=`expr $entry + 1` if [ “`cat /boot/grub/grub.conf | grep ‘^title’ | tail […]

Backup storage: CentOS & QNAP & iSCSI

I’m using a CentOS 6 box as backup server running BackupPC. Until a couple days ago I had a Thecus N7700PRO NAS with 4x 3 TB discs configured as RAID5 which was accessed via iSCSI from the CentOS box. Then, 2 harddrives died at the same time (or not, at least that’s what the […]

CentOS: Fix broken yum repo metadata

Happened because I added EPEL, I believe. Very strange, on another, identical machine (steps 1:1) it worked fine, but on this box suddenly this appeared when trying to yum install something:

[…] –> Processing Dependency: libnuma.so.1()(64bit) for package: libvirt-0.10.2-29.el6_5.11.x86_64 –> Processing Dependency: libnl.so.1()(64bit) for package: libvirt-0.10.2-29.el6_5.11.x86_64 –> Processing Dependency: libnetcf.so.1()(64bit) for package: libvirt-0.10.2-29.el6_5.11.x86_64 –> […]

No MySQL root access when installing Galera from binaries on CentOS 7

EDIT: I AM the one who is stupid! Arrrrgh. Just installed Galera on yet another box and saw this passing by in yum:

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in ‘/root/.mysql_secret’.

Arrrrghhhh. Apologies to the RPM packagers. EDIT END.

Stupid RPM packagers screwed […]

Disable IPv6 on Linux (CentOS)

Disable IPv6 on Linux (CentOS)

Just put this into /etc/sysctl.conf. No need to mess with the IPv6 modules.

net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1

And also inet_protocols = ipv4 in /etc/postfix/main.cf

Why would you want to do that? I have a rogue IPv6 router advertising going on in my network that I can’t block. That […]

reverse mapping checking getaddrinfo” and “POSSIBLE BREAK-IN ATTEMPT” error messages via SSH

$ ssh hostname reverse mapping checking getaddrinfo for client.example.com [10.0.0.1] failed – POSSIBLE BREAK-IN ATTEMPT! username@hostname password: Resolution

There are several ways to resolve this issue:

Setup a Reverse DNS Record (aka PTR Record) for the SSH client. Ensure UseDNS no and GSSAPIAuthentication no are set in /etc/ssh/sshd_config on the SSH server, then restart […]

AWS CentOS7 error countermeasure

If you type a command to check for errors, an error came out. When I typed a command to confirm the error, an error came out.

egrep -i “warning|error” /var/log/messages

[root@ip-172-31-30-74 log]# egrep -i “warning|error” /var/log/messages Feb 10 23:15:03 localhost rsyslogd-2307: warning: ~ action is deprecated, consider using the ‘stop’ statement instead [try http://www.rsyslog.com/e/2307 ] […]

How to use tmpwatch Command in Linux

How to Install tmpwatch CentoOS/Fedora/RHCE :

By default, this package not being installed in Linux (VPS) so that we can install using yum command,

# yum install tmpwatch -y … Running Transaction Installing : tmpwatch-2.9.16-4.el6.x86_64 1/1 Verifying : tmpwatch-2.9.16-4.el6.x86_64 1/1 Installed: tmpwatch.x86_64 0:2.9.16-4.el6 …

tmpwatch Installed Location,

# whereis tmpwatch

tmpwatch: /usr/bin/tmpwatch /usr/sbin/tmpwatch /usr/share/man/man8/tmpwatch.8.gz

How […]

How to change your CentOS server timezone

How to change your CentOS server timezone

Timezone data (tzdata) is stored in /usr/share/zoneinfo.

To change your CentOS server’s timezone, simply run the following command based up on the examples below:

Example 1: set time zone to Melbourne, Australia cp /usr/share/zoneinfo/Australia/Melbourne /etc/localtime Example 2: set time zone to UTC cp /usr/share/zoneinfo/UTC /etc/localtime

To confirm […]

sshd_config hardening

It seems that in Debian 8 (OpenSSH 6.7), diffie-Hellman-group1-sha1 is disabled by default. A client that connects via SSH receive the error:

Server does not support diffie-hellman-group1-sha1 for keyexchange

I tried adding

Code: KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sh Example

KexAlgorithms diffie-hellman-group-exchange-sha256,curve25519-sha256@libssh.org