Wise people learn when they can; fools learn when they must - Arthur Wellesley

Tuesday, 31 January 2017

LINUX-24 SERVICE MANAGEMENT FRAMEWORK (RHEL-7) [PART-1]


   LINUX-24
    SERVICE MANAGEMENT FRAMEWORK (RHEL-7)
                  SYSTEMD/SYSTEMCTL – PART-1

Systemd: system management daemon

First process while booting RHEl-7 is “systemd”. In RHEL-7 the legacy “init” daemon and the “upstart” process is replaced by “systemd”.
Systemd makes the boot faster by starting services in parallel by keeping track of all dependencies between units and only those services are started which are strictly required at boot, rest services are started on demand.

Saturday, 28 January 2017

LINUX-23 SYSTEM LOGGING (RHEL-7) (PART-6)


LINUX-23 SYSTEM LOGGING (RHEL-7)
-------JOURNAL-2--------

We almost covered journal, except few things.

·         The configuration file.
·         How to make journal logs persistent.
H  How a regular user can access journal logs.
H  How to determine journal log size.

First let’s check how to make the journal logs persistent, so that we can check previous boot logs also.

Tuesday, 24 January 2017

LINUX-22 SYSTEM LOGGING (RHEL-7) (PART-5)


LINUX-22 SYSTEM LOGGING (RHEL-7)
                            (PART-5)
                     --------JOURNAL-1--------

Syslog is working fine for log collection/movement/rotation; simply it is taking care of system logs by all manners.
But we have a new service for logs called “JOURNALCTL” which is managed by “SYSTEMD-JOURNALD” daemon. Obviously this new service is part of “SYSTEMD”.

What “systemd-journald” is doing for us?

Friday, 20 January 2017

LINUX-21 SYSTEM LOGGING (RHEL-7) (PART-4) PARTIAL


LINUX-21 SYSTEM LOGGING (RHEL-7)
                                    (PART-4)
INCOMPLETE……UNDER PREPARATION……



RSYSLOG SERVER…………………………..

Configuration File,

/etc/rsyslog.conf

Monday, 16 January 2017

LINUX-20 SYSTEM LOGGING (RHEL-7) [PART-3]


LINUX-20 SYSTEM LOGGING (RHEL-7)
                           (PART-3)

………………LOGROTATE…………………

Log means, to capture any or specific type of activity, log generation and capturing is a continuous process. If this is true then also the log files will grow accordingly. So there must be a requirement to rotate, compress or remove such log files.

Here comes the Logrotate…..

[root@rhel7-server ~]# cat /etc/logrotate.conf

LINUX-19 SYSTEM LOGGING (RHEL-7) [PART-2]


LINUX-19 SYSTEM LOGGING (RHEL-7)
                           (PART-2)

·         Enable/Create custom log

Enable/Create custom log………..

**log all Bash commands by all users on a server**

[root@rhel7-server ~]# cp /etc/bashrc /etc/bashrc.org

[root@rhel7-server ~]# vim /etc/bashrc
Add following line at end çç
export PROMPT_COMMAND='RETRN_VAL=$?;logger -p local6.debug "$(whoami) [$$]: $(history 1 | sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'

Saturday, 14 January 2017

LINUX-18 SYSTEM LOGGING (RHEL-7) [PART-1]


LINUX-18 SYSTEM LOGGING (RHEL-7)
                  (PART-1)
It’s very easy to hit,

[root@rhel7-server ~]# tail -f /var/log/messages
[root@rhel7-server ~]# tail -f /var/log/cron
…………etc……etc……etc….

And get all info,

But what info and how…??

Friday, 13 January 2017

LINUX-17 DISK QUOTA ON “XFS” (RHEL-7)


LINUX-17 DISK QUOTA ON “XFS” (RHEL-7)

A way to limit the users to eat disk space.

Quota can be implemented on behalf of,

·         Block size:     limit by block size
·         Inode no:       limit by inode/no of files

Limit is also differentiated in,

·         Soft Limit: For warnings, it’s like a barrier means if you jump the
 Barrier you will be notified about the jumping incident.
·         Hard Limit: No way, you jumped the barrier and we notified about your  daredevil act. Now we can not allow you to cross the limits.

Thursday, 12 January 2017

LINUX-16 DISK QUOTA (RHEL-6)


LINUX-16 DISK QUOTA (RHEL-6)

A way to limit the users to eat disk space.

Quota can be implemented on behalf of,

·         Block size:     limit by block size
·         Inode no:       limit by inode/no of files

Limit is also differentiated in,

·         Soft Limit: For warnings, it’s like a barrier means if you jump the                   barrier you will be notified about the jumping incident.
·         Hard Limit: No way, you jumped the barrier and we notify about your  
               daredevil act. Now we can allow you to cross the limits.

Tuesday, 10 January 2017

LINUX-15 BONDING/NIC TEAMING IN RHEL-6


LINUX-15 BONDING/NIC TEAMING IN RHEL-6



[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cp ifcfg-Auto_eth1 org.ifcfg-Auto_eth1
[root@localhost network-scripts]# cp ifcfg-Auto_eth2 org.ifcfg-Auto_eth2
[root@localhost network-scripts]# cp ifcfg-Auto_eth3 org.ifcfg-Auto_eth3
[root@localhost network-scripts]# cp ifcfg-eth0 org.ifcfg-eth0

Monday, 9 January 2017

LINUX-14 JOB SCHEDULING (ANACRON)


LINUX-14 JOB SCHEDULING (ANACRON)

We studied about cron in previous post; it is enough to take care of my scheduled jobs.

Then Why anacron…??

Let’s say your company has not paid the vendor for AMC renewal. The UPS of rack is faulty. And the state electricity board has some problem which continues to next 10 days.

Now What…?

Sunday, 8 January 2017

LINUX-13 JOB SCHEDULING (AT/CRON)


LINUX-13 JOB SCHEDULING (AT/CRON)

I am not in front of system, but there is very important task which must be done now…

How it is possible…?

Either I go to office and do that, or I share my root credentials with someone whom I trust and elaborate the whole task along with each and every command.

In my opinion, these are the only ways.

Thursday, 5 January 2017

LINUX-12 ACCESS CONTROL LIST (RHEL-7)


LINUX-12 ACCESS CONTROL LIST (RHEL-7)


Well, all regular/special permissions are done. Our files/directories can be secured by several ways. I have too many tools for that.

Now relaxed……

And then I announced my great knowledge everywhere, my boss also heard about my knowledge, and assigned a task where I supposed to create a script which can be run by 4 users and members of 6 groups.

Great, now I can implement my super knowledge and stun my boss with my skills.

LINUX-11 ADVANCED PERMISSIONS (RHEL-7)


LINUX-11 ADVANCED PERMISSIONS (RHEL-7)

·         Advanced permissions (SUID, SGID, STICKY BIT)
·         ID command

STICKY BIT……………………..

Let’s imagine a condition,
Where there is a shared dump directory having access of 10 users. All users are allowed to create/delete files.

That’s very ideal condition, where all are happy.

User A has 10G of movies collection.
User B has 15G of CBT’s collection.
User C has 8G of games collection.
User D has 5G of songs collection.

Monday, 2 January 2017

LINUX-10 SPECIAL ATTRIBUTES & UMASK (RHEL-7)


LINUX-10 SPECIAL ATTRIBUTES & UMASK

·         Special file attributes
·         umask

SPECIAL FILE ATTRIBUTES……………..

What we learned till now about file perms are rwx with ugo.
Beyond that “rwx” we have other perm also,

lsattr” to view the attributes and “chattr” to change the attributes.

[root@rhel7-server user1]# su - user1
Last login: Sun Jan  1 15:57:52 IST 2017 from 192.168.234.1 on pts/0

[user1@rhel7-server ~]$ pwd
/home/user1

Sunday, 1 January 2017

LINUX-9 USER ENV & SHELL (RHEL-7)


LINUX-9 USER ENV & SHELL (RHEL-7)

  • ·         USER ENVIRONMENT
  • ·         SHELL STARTUP FILES (SYSTEM)
  • ·         SHELL STARTUP FILES (USER)
  • ·         LOGIN PROMPT
  • ·         LOGIN SHELLS
  • ·         HOW TO SET VARIABLES



USER ENVIRONMENT…………………………………..

Whenever a user logged in to system, environment comes in picture. It’s like a room decorated according to need.

Env. Can be created as per specific user basis as well as global basis means system wide.