Category Archives: LFCS

Setup Postfix and Dovecot in CentOS7

Install Postfix: yum install postfix postconf   inet_interfaces = all                           (Listen on all configured interfacesIPs) postconf   mynetworks_style = subnet             (Enable trusted subnet) systemctl restart postfix; systemctl enable postfix Allow smtp … Continue reading

Posted in LFCE, LFCS, Linux | Tagged

shell and ssh basics

sudo: sudo bash -c “echo ‘user ALL=(ALL) NOPASSWD: ALL’ > /etc/sudoers.d/user“ sudo bash -c “echo ‘%grp ALL=(ALL) NOPASSWD: ALL’ > /etc/sudoers.d/grp“ sudo bash -c “echo ‘user ALL=NOPASSWD: /usr/bin/ls, /usr/bin/cat’ > /etc/sudoers.d/user“ su – user; sudo ls -l /etc/        (Switch to user and verify sudo … Continue reading

Posted in LFCE, LFCS

Linux boot loader

grub2 (Boot) commands: grub2-* grub2-mkconfig Configs: /etc/default/grub /boot/grub2/grub.cfg /etc/grub.d/* Get kernel config options: cat /boot/config-$(uname -r)  Backup Master Boot Record (MBR): MBR record = 512 bytes Bootstrap = 446 bytes Partition table = 64 bytes Signature = 2 bytes Use … Continue reading

Posted in LFCS, Linux

Kernel parameters, module and resource limits

Configure Kernel parameters at run-time: sysctl -a sysctl kernel.pid_max; cat /proc/sys/kernel/pid_max sysctl kernel.pid_max=3000; echo 3000 > /proc/sys/kernel/pid_max sysctl -p               (reloads the config param from /etc/sysctl.conf ) sysctl –system   (reload the config param from /etc/sysctl.d/99-sysctl.conf) Configs: /etc/sysctl.conf  /etc/sysctl.d/*.conf Resource limits … Continue reading

Posted in LFCS, Linux

Systemd and SysVinit commands

systemd: systemctl list-unit-files  –type=service|socket  –-state=enabled|disabled|static systemctl list-units -type service –all|–state=active|running|loaded|failed systemctl daemon-reload        (Reload systemd manager configuration) systemctl –failed                       (Show failed services at boot) systemctl start|stop|status|restart|reload|show  foo.service systemctl enable|disable    foo.service systemctl … Continue reading

Posted in LFCS, Linux

Disk partitioning, formatting, usage and mount

Disk Partitioning: Manage disk partitions: fdisk /dev/sda parted /dev/sda  partprobe -s  /dev/sda                         (Reload partition table) List disk partitions: fdisk -l ;     fdisk – l  /dev/sda parted -l;  parted   /dev/sda   print  lsblk  … Continue reading

Posted in LFCS, Linux

Schedule jobs with cron and at in Linux

crontab  (Schedule jobs to be run repeatedly) crontab  -l|-e|-r           (Lists, Edit and Remove respectively user cron jobs)  crontab  -u user  -l|-e crontab  script.sh Configs: /etc/crontab     (Schedule system wide cron jobs) /etc/cron.d         Examples: @reboot, @hourly, … Continue reading

Posted in LFCS, Linux