Basics Perf is useful profiling tool which might be useful to trace kernel/application calls/functions and many more. For example to start perf as a live monitor tool similar to top execute: # perf top It will display performance counters in real time. Example output: PerfTop: 474 irqs/sec kernel:100.0% exact: 0.0% [4000Hz cpu-clock], (all, 6 CPUs) […]
CentOS/RHEL
ldconfig Command Options
ldconfig command is used to tell the system about new locations of shared libraries, the ldconfig command uses information provided by the /etc/ld.so.conf file. The ldconfig command creates a cache database of all libraries based on the configura- tion file. This cache is normally stored in the /etc/ld.so.cache file. Here is the syntax of the […]
“cannot install the best update candidate for package” – error on running dnf update
The Problem Running the ‘dnf update’ command fails with below error: # dnf update Error: Problem 1: package perl-4:5.26.3-419.el8.x86_64 requires perl-interpreter(x86-64) = 4:5.26.3-419.el8, but none of the providers can be installed – cannot install both perl-interpreter-4:5.26.3-419.el8_4.1.x86_64 and perl-interpreter-4:5.26.3-419.el8.x86_64 – cannot install the best update candidate for package perl-interpreter-4:5.26.3-419.el8.x86_64 – cannot install the best update candidate […]
ldd Command Options in Linux
You can see what shared libraries a specific command uses by using the ldd command. Here is the syntax of the ldd command: # ldd [options] FILE For example: # ldd /bin/cp linux-vdso.so.1 => (0x00007ffc35df9000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f93faa09000) libacl.so.1 => /lib64/libacl.so.1 (0x00007f93fa800000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f93fa5fa000) libc.so.6 => /lib64/libc.so.6 (0x00007f93fa239000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f93f9fd8000) […]
How To Configure sssd To Work With Multiple Active Directory Domains in Different Forests (CentOS/RHEL)
This post describes an approach to configuring sssd in order to interact with multiple Active Directory Domains located in different forests. This method involves altering /etc/krb5.conf and /etc/sssd/sssd.conf files. 1. Join the first domain (domain1.com) from the first forest. # realm join –verbose domain1.com -U LinuxAD@DOMAIN1.COM 2. Edit /etc/krb5.conf file and add the secondary domain […]
How to remove unwanted entries in /etc/shadow file
Question: How to remove all the unnecessary user entries in /etc/shadow file? 1. Create a backup copy of /etc/shadow file. # cp -p /etc/shadow /etc/shadow.backup 2. Ensure the user is not existing anymore in /etc/password file. # cat /etc/passwd | grep [userid] 3. Edit the /etc/shadow file, look for the line and remove the unnecessary […]
How to run ssh on multiple ports
Question: How to confgure ssh to run on 2 ports i.e. 22 and 2222. There may be requirements as such above in some environments to run ssh on multiple ports. Well this can be achieved by modifying the /etc/ssh/sshd_config configuration file. The stpes are outlined as below: 1. Edit the sshd configuration file /etc/ssh/sshd_config # […]
Bind to port 22 on 0.0.0.0 failed: address already in use – error while starting sshd service CentOS/RHEL
The Problem Following messages are logged when restarting sshd service in a CentOS/RHEL 5/6 system. Dec 14 00:15:19 geeklab sshd[9182]: Received signal 15; terminating. Dec 14 00:15:19 geeklab sshd[9274]: Server listening on :: port 22. Dec 14 00:15:19 geeklab sshd[9274]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use. The Solution When […]
“error: Bind to port 2222 on 0.0.0.0 failed: Permission denied” – error while starting sshd service on CentOS/RHEL
The Problem On CentOS/RHEL, the OpenSSH SSH Daemon (sshd) utilizes port 22 for incoming connection requests from remote OpenSSH SSH (ssh) and Secure File Transfer (sftp) clients. In some cases, however, System Administrators prefer to utilize separate ports to service ssh and sftp activity. In One such case, system administrator is facing below error while […]
Shell Script to Find Network Interface Link Status and Speed (CentOS/RHEL)
This post provides a sample script detecting which interfaces are configured on the system, and in them, which ones do have their links up and at which speed they are operating. Note, that the reported speed within virtual machines may not be correct. A virtualized network adapter has to pretend to have a “speed” because […]