Thursday 8 March 2018

Checking for softnofiles=4096; softnofiles=1024. Failed installation check issue with limits.com SOLVED and EXPLAINED

In case you have try to install some Oracle software you have to setup hard and soft limits. This is done in /etc/security/limits.conf. After changing these settings, you need to logoff for these settings to take effect.


Checking for softnofiles=4096; softnofiles=1024. Failed

So even if you set your user to have soft nofile limit to your preferred value, changes did not take effect. Why?

This is for Red Hat Enterprise Linux Server  7.4, I suppose that same is in other distros.

These parameters CAN NOT be greater then value that is applied to super-user root! So if your root soft limit is 1024, then your no-seper-user cannot be grater then 1024.

How to fix this?

In limits.conf add this

root - nofile 100000
user soft file 4096

and DO NOT CLOSE YOUR SESSION BECAUSE IF THERE IS ANY ISSUE YOU WILL NOT BE ABLE TO LOG BACK IN WITH PUTTY! So just start new session and check these parameters.
Also, remember this - hard limits should be greater or equal to soft limits!


Friday 2 March 2018

SSH X11 forwarding Error: Can't open display: issue on rhel 7.x SOLVED and EXPLAINED

There is no need for installing XVNC server on your server or installing desktop environment in case someone need GUI for installing some applications like Oracle DB or some web application.

You can use SSH X11 forwarding to GUI stuff.

What is SSH X11 forwarding?

First you need to know what X11 is. Simple said - X11 is GUI. What is SSH? SSH is short from Secure SHell. You can connect to server with SSH sessions by using putty or some other program.
SSH session is very "light" and it is used for CLI access to server.

SSH X11 forwarding will enable GUI through SSH session. Meaning? You use GUI  environment of your client machine to do work on server that needs to be done from GUI!

Why is this probably better then installing complete GUI environment on your server? Because, GUI environment can be pretty big and depending on your server resources can consumed much needed CPU or memory.

Check list for enabling SSH X11 forwarding

To enable X11 forwarding you do need to install few packages and make some configuration adjustments!

Step 1 - enabling SSH X11 forwarding

Because I am doing this on RHEL 7.4, names of packages may slightly differ.

Packages are:

xorg-x11-xauth
xorg-x11-fonts-* 
xorg-x11-utils

It is wise to install and xorg-x11-utils because it provides xclock, simple GUI clock that can be test if you SSH X11 forwarding is working.

So:

yum install xorg-x11-xauth xorg-x11-fonts-* xorg-x11-util

Step 2 - enabling SSH X11 forwarding

 Check if X11 forwarding is enabled. This is checked in SSH server configuration file

#:cat /etc/ssh/sshd_config |grep X11FoX11Forwarding yes





I have to be yes if you want this to work.




Step 3 - enabling SSH X11 forwarding

This step is needed for RHEL 7.X, Centos 7.X.

In sshd_config file there is parameter named AdressFamily. This parameter is by default set to any.

cat /etc/ssh/sshd_config |grep any
#AddressFamily any

Even do this parameter is commented, it is active because, default value is any. What does this mean anyway? Address Family is referred acceptance of connections from ipv4 or ipv6 networks. Any means it can be both but first is default value of OS. In older Linux distributions, default value any was referred to ipv4 address family. In newer distros such as RHEL 7.X or Centos 7.x, value any is referred to ipv6 adress family.

Funny thing is that if this parameter is set to any, you can connect to server with regular SSH session(no X11 forwarding) but if you connect to SSH with X11 forwarding enabled on your client, you will not be able to start X11 session. Your error will be

program you want to run Error: Can't open display:

In my case this is

# xclock
Error: Can't open display:
 
If you, did not set this right, your X11 SSH session will not have DISPLAY variable set. exit

After all this is set, you can start your SSH X11 forwarding session!