Category Archives: cPanel

cPanel – http://cpanel.net

Cron: ERROR: failed to open PAM security session

This issue is related to PAM not authenticating the users correctly anymore because of a few possible modifications, or something got screwed up on your server.

If you get this error you may wan to try and see if the user that is trying to run that cron exists under /etc/shadow file.

As Andrew pointed up in one of the comments you can also get this error if the cron user’s account has expired so you may want to verify that before going ahead.

If you hardened your server security using some of the scripts that are floating around the internet and now get a CRON (username) ERROR: failed to open PAM security session: Success error you may wan to check the /var/log/secure log file and check for any references to cron like:

Jul 7 16:30:01 server crond[9527]: pam_access(crond:account): access denied for user `username' from `cron'

A fix for this is to check the following two files and make sure that the lines in there match the following:

/etc/pam.d/crond file should contain the following lines:

auth sufficient pam_rootok.so
auth required pam_env.so
auth include system-auth
#account sufficient pam_rootok.so
account required pam_access.so
account include system-auth
session required pam_loginuid.so
session include system-auth

Check the commented line #account sufficient pam_rootok.so and if you see this line in there and uncommented the comment it out.

Secondly check the /etc/security/access.conf file and if you see at the end of this file anything that is uncommented like:
-:ALL EXCEPT root:LOCAL

+ : ALL : cron crond

then comment this two lines also.

Check your cron log file after this and see if the cron will run correctly.

Share/Bookmark

Apache handlers under Apache2

Seems that under apache 2 the handlers are not working like in the apache 1.3 version so a handler like this: AddType text/html .html will not work anymore and may only create issues when in an .htaccess file.

A simple way around this is to login to Cpanel and under Apache Handlers set this:

.html server-side
.htm server-side

Once this is done your handlers should work fine under both FF and IE browsers .

Exim – list of useful commands

I put together a small list of useful commands for Exim mail server, needless to say that i am using this commands on a day-to-day basis.

exim -bp – Shows exim mail queue
exim -M emailID – Force delivery of one message
exim -Mvl messageID – View Log for message
exim -Mvb messageID – View Body for message
exim -Mvh messageID – View Header for message
exim -Mrm messageID – Remove message (no errors sent)
exiqgrep -zi | xargs exim -Mrm – Remove all frozen emails in queue
exiqgrep -i -f '<example@example.com>' | xargs exim -Mrm – Delete the emails from that address
exiqgrep -i -o 172000 | xargs exim -Mrm – Delete the emails which were not delivered 2-3days
exim -bpc – Show emails number in queue
exim -d -bt your@email.com – To see where exim is delivering (resolving the mail) login to your server
exim -bpru |awk '{print $3}' | xargs -n 1 -P 40 exim -v -M – This will force the queue and will run multiple instances along