LINUX Help

The best thing about CentOS 7 is, it has a super easy firewall built-in. I recommend you not to disable the firewall. To check the active zones: [root@rh7 ~]# firewall-cmd –get-active-zones public interfaces: enp1s0f0 To get available service names: [root@rh7 ~]# firewall-cmd –get-services RH-Satellite-6 amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns ftp high-availability http https imaps […]

rdesktop is the essential tool for Remote Desktop Management of Windows boxes using Linux as your local machine. It is sometimes crucial to be able to transfer files using rdesktop, especially when there isn’t any FTP service (or equivalent). Luckily rdesktop supports file transfer modes. Before connecting you the Windows box, let’s make a directory […]

Below I’ll describe a couple of nice methods to generate passwords using Python and Bash. Actually there are a lot of ways you can accomplish this especially with bash, but using the /dev/urandom file seems to be the most clever one. The /dev/urandom device doesn’t only generate read-friendly characters, so it’s best to filter out […]

[zimbra@ck]$ zmcontrol start Host mail.plugged.in Starting ldap…Done. Unable to determine enabled services from ldap. Enabled services read from cache. Service list may be inaccurate. Starting logger…Failed. Starting logswatch…ERROR: service.FAILURE (system failure: ZimbraLdapContext) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) zimbra logger service is not enabled! […]

Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn’t work on compressed files. To overcome this, people usually advise to first  uncompress the file(s), and then grep your text, after that finally re-compress your file(s)… You don’t need to uncompress them in the first place. You can use […]

If you want to clear contents of a file in unix, you could just delete the file and recreate it. But there are much more simple alternatives. You can use echo method. To empty a file just enter the command below. I use my php_error.log file for example. echo -n > /home/base/logs/php_error.log That’s it. Your […]

The other day I was working on a server and needed the LARGEST files on some directory – including its subdirectories. As it turns out, it’s a very simple task limiting the file size you want with the output of the find tool. The -size argument will define the borders of your output. Let’s say […]

Adding a task into crontab is relatively easy. You just enter the crontab with “$ crontab -e” and add the necessary job, save and exit. But adding a job in your bash script is not that simple, because what you have to do is, to get the entire list of the jobs, append your new […]

You are reading this article, most probably you faced trouble booting your Linux. Follow the steps below to fully chroot into your system as you booted regularly. Please note that we offer you to take a disk clone before doing anything in your boot configuration. To do so, you can use dd or dd_rescue to […]

If you want to show console output from a Serial device such as RS-232 interface, you need to make minor modifications in pfsense 2.0 distro. Switch to shell by pressing 8 from the pfsense console menu and edit the file /boot/loader.conf by typing: vi /boot/loader.conf Add the below lines to the file after pressin “i” […]

Vi is the one of the mostly used editor in Linux via terminal. In most cases where Linux is used as a server operating system, admins use the terminal, where GUI uses more system resources & network bandwidth. Since Vi is used from the terminal, the lack of GUI force the user to learn function […]

Updating RedHat & CentOS with Yum If you are using RedHat & its clones like CentOS or CloudLinux etc. you can use Yum or up2date to upgrade your current system. Please note that is you have a RedHat Enterprise Linux Subscription we offer you to use the command up2date, to upgrade your server with yum […]

You can use du command to see the folder size in LINUX including subfolders.: With du du -h # including subfolders (-h means human readable format in MB, GB or TB) If you want to exclude subfolders, type: du -h –max-depth=1   If you want to know a specific folders size (easy to remember) type: […]

In default LINUX installation IPv6 is enabled. IPv6 might use system resources or for what ever reason you have Run this command as root: echo “alias net-pf-10 off” >> /etc/modprobe.conf echo “alias ipv6 off” >> /etc/modprobe.conf You need to restart your server after this command.

LINUX Version Info To learn the architecture and kernel version info use the shell command below: less /etc/redhat-release The output will be like CentOS release 5.6 (Final) To learn the architecture & kernel version: uname -a you can use the command above, the last numbers marked as red below is your architecture: Linux xxx.veriportal.com 2.6.18-164.9.1.el5 […]

NTP (Network Time Protocol) could be used to set time synced with ntp clocks, to do this use the shell command below: Setting time with NTP: yum install ntp -y \cp -f /usr/share/zoneinfo/Europe/Istanbul /etc/localtime ntpdate -v -b in.pool.ntp.org And set the hardware clock with: hwclock -w

You can make a search inside files within a a directory using the command “find“, to do that: with the find command cd /to_folder find . -iname ‘*conf’ | xargs grep ‘string’ -sl -iname ‘*conf’ states that the seach will only check the files ending with *conf, using -iname ‘*’ will search inside all the […]

If you own your DNS servers, you should probably want to close recursive queries being gathered from your servers. In named.conf edit the options directive and add: options { allow-transfer {Secondary Server IP; }; allow-recursion { 127.0.0.1; A.B.C/24; }; }; In secondary server: add to options: allow-transfer { none; }; allow-recursion { 127.0.0.1; A.B.C/24; };

The standart linux distrubition calls that the ephemeral port range be between 1024 and 4999. We we all know that some of these ports are used for other more importand applications than FTP. So security is an issue because leaving those original ports open leads to major security holes. Rather than openning ports that need […]