Category Archives: Linux

Linux being one of the most widely used system now a days we shared tips here which user may find useful
The commands and tricks being shared are already implemented on production servers
which you can use without any worries.

FAILED to open PAM security session (Module is unknown)

Cron Jobs in server were not getting executed automatically

On investigating I could see error like

Jun 16 14:05:01 ok1110 crond[5913]: (root) FAILED to open PAM security session (Module is unknown)
Jun 16 14:05:01 ok1110 crond[5912]: (root) FAILED to open PAM security session (Module is unknown)
Jun 16 14:06:01 ok1110 crond[6021]: (root) FAILED to open PAM security session (Module is unknown)

On deeper investigating I found the issue was in file

 /etc/pam.d/crond

I went ahead and copied file from working server and fixed this issue.

  • PAM configuration is the default:
$ cat /etc/pam.d/crond
#
# The PAM configuration file for the cron daemon
#
#
auth       sufficient pam_env.so
auth       required   pam_rootok.so
auth       include    system-auth
account    required   pam_access.so
account    include    system-auth
session    required   pam_loginuid.so
session    include    system-auth


If this file is modified the crond does not work for any users.

 

 

 

E: Unable to locate package Ubuntu

While trying to install some new software in Ubuntu I was getting error

E: Unable to locate package Ubuntu

I tried updating using command sudo apt-get update

However it didnt work

sudo apt-get install anydesk_2.9.1-1_amd64.deb
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package anydesk_2.9.1-1_amd64.deb
E: Couldn’t find any package by glob ‘anydesk_2.9.1-1_amd64.deb’
E: Couldn’t find any package by regex ‘anydesk_2.9.1-1_amd64.deb’
home@home:~/Desktop/shraddha$ cd ..

 

You need to use command  sudo dpkg –install    filename.deb to get this installed

 

sudo dpkg –install anydesk_2.9.1-1_amd64.deb
Selecting previously unselected package anydesk.
(Reading database … 247265 files and directories currently installed.)
Preparing to unpack anydesk_2.9.1-1_amd64.deb …
Unpacking anydesk (2.9.1-1) …
Setting up anydesk (2.9.1-1) …
Processing triggers for gnome-menus (3.13.3-6ubuntu3) …
Processing triggers for desktop-file-utils (0.22-1ubuntu5) …
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) …
Rebuilding /usr/share/applications/bamf-2.index…
Processing triggers for mime-support (3.59ubuntu1) …
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) …
Processing triggers for man-db (2.7.5-1) …

 

 

 

 

***** FATAL: Failed to download updatenow.static from server: The system cannot update the /var/cpanel/sysinfo.config file. at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 115.

While trying to upgrade cpanel  to new version was getting error

FATAL: Failed to download updatenow.static from server:

The issue was due to corrupt RPM

I used the below fix to resolve this issue


mkdir /root/old_rpm_dbs/

Now move the original RPMs to the new folder

mv /var/lib/rpm/__db* /root/old_rpm_dbs/

Finally rebuild the RPM database

rpm --rebuilddb

Now you can force an update of the cPanel server and it should work again.

/scripts/upcp -force

Failed to connect 1006 VNC virtualizor

While working on one of the nodes which has Virtualizor Software was facing issues accessing VNC . giving error failed to connected 1006

The issue was due to Virtualizor upgrade

Below is the command you need to execute to kill all process using below command for VNC to work

[root@os1126 ~]# kill $(pgrep -f “/usr/local/virtualizor/enduser/themes/default/novnc/utils/websockify”)
[root@os1126 ~]# kill $(pgrep -f “/usr/local/virtualizor/enduser/themes/default/novnc/utils/websockify”)
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]

Now after retrying accessing virtualizor I can see it working fine

“chown: Invalid username: root:Disk”

The server was not allowing login to server even when ssh keys were saved

On rebooting server I could see it and error on screen “chown: Invalid username: root:Disk”

On troubleshooting found error to be due to corruption of /etc/passwd  as this is where all users are saved and due to corruption the user  root was missing in  /etc/passwd

So I got the serve in single user mode and fastboot as only single user mode wont server and would restart

Once I got access to single user I just moved the /etc/passwd to /etc/passwd.bkp and  copied  /etc/paswd.OLD which was in  /etc to /etc/passwd

Now on rebooting server i can see it working fine. 🙂

Incorrect DiskSpace and Information in cPanel

While working on one clients vps for incorrect disk usage  stats for mails

While the default cpanel has no emails the usage stats showed 750MB.

After going through I found a issue which was causing this

The file causing this issue was maildirsize

maildirsize is the file which shows stats information for each account

root@vps [/home/designse]# find . -iname maildirsize
./mail/designserver.net/gordon/maildirsize
./mail/designserver/gordy/maildirsize
./mail/designserver/auctions/maildirsize
./mail/designserver/homemedia/maildirsize
./mail/maildirsize

I went ahead and deleted the file to fix this issue.
root@vps [/home/designse]# cd mail/
root@vps [/home/designse/mail]# rm -rf maildirsize
root@vps [/home/designse/mail]#

Now all stats shows right details

 

 

 

 

Emails going to Spam folder issue

We do get complaints of emails going to spam folder most of the times while working.

The solution to such a issues depends on 3 things

  1. rdns for the IP address and matching A record for the domain name in question.
  2. Need to setup right SPF
  3. Need to setup right DKIM

a) To setup SPF for a domain name can use tool http://www.spfwizard.net/

b) For DKIm you can use tool  from Socketslab

Domain Key / DKIM Generation Wizard

for DKIm you can use key name as key1 or domain1 or any random words

c) Once done you can check whether its valid or not using a vaiidator

http://dkimvalidator.com/results

For validitor you need to send email to email ID shown on screen and check once done click on show results

Where it will show if set  DKIM and spf are valid or not

 

 

 

E-mail accounts not showing in cPanel

The issue when you open “Email accounts” in cPanel, it sometimes doesn’t show up the list of Email accounts the domain have but only just a blank page without any email account

No Email Accounts”!

This happens due to bulk of cache, temp files etc present in the .cpanel directory of domain. In order to rectify the problem we can remove the “.cpanel” directory inside the path /home/cpaneluser/.

Once removed restart the cpanel service and try access the cpanel page/email accounts.

The issue will be solved. No issues with the “.cpanel” directory, it will automatically recreate next time when you load the account’s cPanel.

Softacalous blank issue cPanel/WHM

While working one of the clients server

We saw an issue where going from WHM > plugin > Softacalous and opening it resulted in blank page.

The issue is due to corrupt files in softacalous.

To fix this issue softacalous need to be reinstalled

to reinstall to go

cd  /usr/local/cpanel/whostmgr/docroot/cgi/

rm -rf softaculous

cd /home

wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh


Once done softacalous was working fine