WebMail connection timeout + CSF

If you have CSF installed as the IDS of choice and you have a SMTP timeout on WebMail when trying to send mail, the problem is probably in the csf.conf setting.

Error:

Connection timed out
Server replied: 110 Can’t open SMTP stream.

Solution:

Modify SMTP_BLOCK=”1″ or even better SMTP_ALLOWLOCAL=”1″ in /etc/csf/csf.conf.

Uncategorized

Various linux resources

DNS

O’Reilly’s DNS and Bind

http://docstore.mik.ua/orelly/networking_2ndEd/dns/index.htm

cPanel 3rdparty software:

http://forums.cpanel.net/f77/third-party-applications-available-cpanel-whm-106785.html

NSF

http://www.faqs.org/docs/Linux-HOWTO/NFS-HOWTO.html#FIREWALLS

linuxguruz.org

Uncategorized

"Firewall is stopped" error

This is required to stop iptables without the entire system getting hanged on “unloading iptables modules” ON SOME MACHINES.

/etc/sysconfig/iptables-config => IPTABLES_MODULES_UNLOAD=”no”

Further info: http://forums.fedoraforum.org/showthread.php?t=44196

This is required when you get a “Firewall is stopped” and a simple restart doesn’t cut it.

service iptables save

service iptables restart

Further info:  https://www.linuxquestions.org/questions/red-hat-31/iptables-is-stopped-513966/

Uncategorized

find

Limiting the search to n levels within the directory structure (must be placed before other options):

find -maxdepth n

Searches for files that are eqaul (n), larger (+n) or smaller (-n) than n:

find . -size [+-]n

n should be followed by c (bytes), k (1000), M (megabyte), G(gigabyte).

More size options can be combined to set an interval for files greater than n but smaller than m:

find . -size +n -size -m

Searches for a certain type:

find -type t

Where t is:

f = file

d = directory

l = symbolic link

b = block file

c = char file

p = named pipe

s = socket

Search by modify date:

Search for files/folders modified exactly 7 days ago (0 for today):

find -daystart -mtime 7

Search for files/folders modified at most 7 xdays ago:

find -daystart -mtime -7

Search for files/folders modified more than 7 days ago:

find -daystart -mtime +7

Instead of mtime can be used atime (access) or ctime (status change). The -daystart option is needed so that find will start counting from now as day 1 instead of day 0 (so 1 would be for today).

Instead of mtime for days can be used mmin for minutes etc.

Searching by permisions

Searching for the exact permissions (octal):

find -perm xxx

Searching for at least xxx permissions:

find -perm -xxx

Searching for any of xxx:

find -perm +xxx

or

find -perm /xxx

Searching by ownership

Search after user x

find -user x

Search after members of group x

find -group x

Other options

To find for all files cu n hard links:

find -links n

To find all files/folders newer than file:

find -newer file

To search after inode n:

find -inum n

To search for empty files or folders:

find -empty

To find files/folders that don’t correspond to any user/group:

find -nouser

find -nogroup

To negate a option prefix it with !

Uncategorized

Linux boot related commands

To find out the current and previous runlevel:

runlevel

who -r

Uncategorized

pgrep

Listing processes after owner:

pgrep -u `owner`

Listing processes with a certain command name (name), long format

pgrep -l

List the oldest (and newest) process of the selected one

pgrep -o name
pgrep -n name

Processes commands

Hardware commands

lspci – listeaza pci-urile
hdparm -I /dev/sda – listeaza parametrii hdd-ului sata master primar

Comenzi legate de smartd:

smartctl -t ata -a /dev/sda
smartctl -d ata -a /dev/sda
smartctl -d ata -a /dev/sdb
cat /proc/mdstat
smartctl -d ata -a /dev/sda
Hardware commands