While extending VG on SD or VDO devices, you may get an error: # vgextend vg1 /dev/mapper/vdo2Devices have inconsistent logical block sizes (512 and 4096). In the above output, vgextend fails due to inconsistent block size of physical volume on disk drives. To resolve this issue, enable allow_mixed_block_sizes in lvm.conf to allow the same VG …
VNC session freezes for a few seconds
VNC hangs due to an increased number of VNC sessions initiated by sshd, being under the closing state. # loginctl list-sessions --no-pager | wc -l49290 A session would be in a closing state if a process within the session stayed alive after the session was closed. # loginctl session-status 4509845098 - root (0)Since: Fri 2021-09-04 13:20:15 …
How to create SFTP shared folder so multiple restricted and chroot Jailed users can access the same folder
You need to migrate windows based SFTP server to the RHEL platform to save cost and make it easy to manage. To build a similar kind of environment as I have on windows, I need to create three types of user accounts, and as you know, chroot jailed means that the account is jailed and …
How to setup VNC server as user in AlmaLinux 8 & CentOS 8
For setting up a VNC server as a Linux user, you must complete all the following steps as the same user. You must ssh to the server as the intended user and must not sudo or su – . The following steps can be used to configure the Xvnc server in Alma Linux 8. Copy …
VNC error – Could not connect to session bus:Failed to connect
Your VNC session may give an error as shown below: Could not connect to session bus:Failed to connect to socket /tmp/dbus-xxxxxx:Connection refused The root cause of this error is that the session bus gets multiple dbus-daemon modules in the default path set for the user. A path for /root/anaconda3/bin was exported and set as the …
nVIDIA vGPU Virtual Machine has missing mouse pointer through VNC console
On Linux based virtual machines, edit the /etc/X11/xorg.conf file and disable HWCursor in the Device section as follows: Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" Option "HWCursor" "off" EndSection
How to login into VNC without a password
You can remove all types of authentications by configuring the vnc server. As user start a vnc session and “-SecurityTypes none” option while starting a vnc server as below: #vncserver :X -SecurityTypes None In the above command, X is the display number at which the vnc session should start. The “-SecurityTypes none” can be added …
How to change the color of the default black Font Awesome icons
You can add the color to the HTML element as follows: <i class="fa fa-car" style="color:#DDDDDD;"><!-- icon --></i> You can also change the size of the icon as follows: <i class="fa fa-car fa-lg" style="color:#DDDDDD;"><!-- icon --></i> <i class="fa fa-car fa-4x" style="color:#DDDDDD;"><!-- icon --></i> You can also make site-wide changes with CSS as follows: .fa {color: black;}.fa-car …
How to disable bash shell history
You can use two methods to disable saving shell history in bash. Method 1: Add the following line at the end of /etc/profile or make a new file in /etc/profile.d/ with .sh extension. unset HISTFILE With the above option, the user’s bash shell will not save history unless manually configures the HISTFILE variable. Method 2: …
error “Cannot allocate memory” while executing commands
You should increase /proc/sys/kernel/pid_max sysctl. Otherwise, execute the following command to check which app is forking multiple threads. #ps -eLF Error “Cannot allocate memory” indicates that the system is running out of PID (process ids). In other words, the number of threads/processes present on the system has reached the maximum limit, which is delimited by …
How to configure system wide proxy for all users shells and yum
http_Proxy environment variable is used to specify proxy settings to wget and curl. To find the proxy server already set on a Linux machine, use the following command: echo $http_proxy To set http_proxy without username and password: export http_proxy=http://SERVER-NAME:PORT/ To set http_proxy with username and password: export http_proxy=http://USER-NAME:PASSWORD@SERVER-NAME:PORT/ To set http_proxy with username, password, and …
How to log all bash history commands to syslog
shopt is a built-in bash variable that enables bash history to be written to /var/log/messages. shopt -s syslog_history If you want to unset it, run the following command. shopt -u syslog_history In order for these audit activities to persist in all bash sessions, append the following to the bottom of /etc/bashrc file. shopt -s syslog_history
How to setup CA Certificate authority with OpenSSH in CentOS 7 Linux
You should first create CA keys on the certificate authority ca server as root: ssh-keygen -f ca_server Check with ls to see if files are created in the current working directory. Following files will be present. ca_server ca_server.pub Sign the host key of the ca server itself. ssh-keygen -s ca_server -I host_auth_server -h -n ca_server.seimaxim.com …
Bash Shell Scripting Cheat Sheet for AlmaLinux, CentOS, and Ubuntu
Bash is by default installed on most Linux distributions like AlmaLinux, CentOS, Kali, and Ubuntu. The following cheat sheet outlines some important features of bash scripting. Bash Script Header #!/usr/bin/env bashecho “Hello World” Variables #!/usr/bin/env bashMSG=”Hello World”echo “$MSG Albert” # Hello World Albertecho ‘$MSG Albert # $MSG Albert Strings MSG=”hello world” Replace echo ${MSG/w/W} # …
How to set up sftp so that user cannot get out of their home directory
This guide deals with how to set up sftp so that users are restricted to their home directory, while other users on the server are not affected. To allow chroot only for specific users, use the Match keyword in /etc/ssh/sshd_config file. Comment the original Subsystem entry in sshd_config file as follows: #Subsystem sftp /usr/libexec/openssh/sftp-server Add …