Red Hat

Red Hat product (RHEL) is a Linux distribution developed by Red Hat.

Ubuntu

Ubuntu is a Debian-based Linux operating system, with Unity as its default desktop environment .

Fedora

Fedora (formerly Fedora Core) is an operating system based on the Linux kernel, developed by the community-supported Fedora Project and owned by Red Hat.

Debian

Debian is an operating system composed of free software mostly carrying the GNU General Public License.

CentOS

CentOS (abbreviated from Community Enterprise Operating System) is a Linux distribution that attempts to provide a free enterprise class computing platform which aims to be 100% binary compatible with its upstream source, Red Hat Enterprise Linux (RHEL).

Thursday, May 15, 2014

Introduction of Shell Scripting


What is Shell ??
A shell is simply a program that is used to start another program. Shell accepts your instruction or commands in English (mostly) and if its a valid command, it is pass to kernel.

All operating system have shells. For example DOS have command.com, Windows have explorer.exe.



Several shell available with Linux including:

Shell Name
Developed by
Where
Remark
BASH ( Bourne-Again SHell )
Brian Fox and Chet Ramey
Free Software Foundation
Most common shell in Linux. It's Freeware shell.
CSH (C SHell)
Bill Joy
University of California (For BSD)
The C shell's syntax and usage are very similar to
the C programming language.
KSH (Korn SHell)
David Korn
AT & T Bell Labs
--
TCSH
See the man page.
Type $ man tcsh
--
TCSH is an enhanced but completely compatible version of the Berkeley UNIX C shell (CSH).

To find all available shells in your system type following command:
$ cat /etc/shells

Normally shells are interactive. It means shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , then you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.

Why to Write Shell Script ?
  • The first thing most people will use shell scripting for is automating a simple task, like backups.
  • Shell script can take input from user, file and output them on screen.
  • Useful to create our own commands.
  • Save lots of time.
  • To automate some task of day today life.
  • System Administration part can be also automated.



Saturday, May 10, 2014

File and Directory Permissions

Permissions is a type of good security features in Linux operating system. Permissions is used to assign on files as well as on directories.



Friday, May 9, 2014

Chage Command with example to manage Linux password expiration


chage - change user password expiry information 


chage changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change her password. The chage command is restricted to the root user, except for the -l option, which may be used by an unprivileged user to determine when her password or account is due to expire.

Thursday, May 1, 2014

Group Management in Linux


Group Management :

 
  • A user can be participated to more than one group at the same time.
  • A user who is member of a group can change to that group without password but a user NOT member can only change to that group if the group password exist and the user gives it.
  • One of more users can become group administrators for specific groups.
  • Group Administrators can:
1.     add/change/delete the password of the group
2.     add/delete users to the group
3.     reserve the group to members-only.

Types of Group:

  • Primary group: Every user must be a member of at least one group, which is identified by the numeric GID in /etc/passwd.
  • Secondary group: A user may be listed as member of additional group in the relevant entries in the /etc/group.
  • User private group: Created whenever a new user is added to the system and has the same name as the user for which it was created.

Example:

$ id
uid=501(linuxcare) gid=502(linuxcare) groups=502(linuxcare),506(rax)


Group Management Commands:

  • groupadd - adding group
      # groupadd admin
      # groupadd -r admin            //start group id 101 and increase up to GID 499
      # groupadd -g 600 admin

  • groupmod - modifying group
      # groupmod [-g new gid] [-n new name] group
      # groupmod -g 600 -n networkcare linuxcare

  • groupdel - deleting group
      # groupdel networkcare

  • gpasswd - administer /etc/group and /etc/gshadow
      # gpasswd networkcare                                   // making new password for networkcare
      # gpasswd -A linuxcare networkcare               // administrator for networkcare
      # gpasswd -R networkcare                             // restrict non-members login
      # gpasswd -r networkcare                              // delete group password

$ gpasswd -a linuxcare networkcare                    // adding new member
$ gpasswd -d linuxcare networkcare                    // deleting group member

  • chgrp - Changes the group ownership of a file or directory.
      # chgrp linuxcare /home/linuxcare


So In this way group can be managed in Linux.