Showing posts with label RHCE. Show all posts

Monday, November 26, 2012

OpenSSH



OpenSSH
OpenSSH is a free, open source implementation of the SSH (Secure SH ell) protocols. It replaces telnet, ftp, rlogin, rsh, and rcp with secure, encrypted network connectivity tools.
All communications using OpenSSH tools, including passwords, are encrypted. Telnet and ftp use plain text passwords andsend all information unencrypted. T he information can be intercepted, the passwords can be retrieved,and your system could be compromised by an unauthorized person logging in to your system using oneof the intercepted passwords. T he OpenSSH set of utilities should be used whenever possible to avoidthese security problems.
Service Profile
Service: sshd
Package: openssh
Configuration file: /etc/ssh/ssh_config     
/etc/ssh/sshd_config      
/etc/ssh/ssh_host_dsa_key     
/etc/ssh/ssh_host_dsa_key.pub        
/etc/ssh/ssh_host_key   
/etc/ssh/ssh_host_key.pub      
/etc/ssh/ssh_host_rsa_key      
/etc/ssh/ssh_host_rsa_key.pub        
Daemon:sshd
Objective :  To provide secure communications between two systems using a client/server architecture and allows users to log into server host systems remotely.
Install the package
[root@raju~]#yum install openssh* -y
Run the service
[root@raju~]#chkconfig sshd on

Read more

Sunday, November 25, 2012

Swap Partition



Swap Partition
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.
While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.
The size of your swap should be equal to twice your computer's physical RAM for up to 2 GB of physical RAM. For physical RAM above 2 GB, the size of your swap should be equal

Read more

Job Automation



Job Automation
In Linux, tasks can be configured to run automatically within a specified period of time, on a specified
date, or when the system load average is below a specified number. Red Hat Enterprise Linux is preconfiguredto run important system tasks to keep the system updated. A system administrator can use automatedtasks to perform periodic backups, monitor the system, run custom scripts, and more.
Red Hat Enterprise Linux comes with several automated tasks utilities: crontab, at.
Crontab
Crontab  is a daemon that can be used to schedule the execution of recurring tasks according to acombination of the time, day of the month, month, day of the week, and week.

Read more

Saturday, November 24, 2012

Group Administration



Group Administration
Linux uses groups to define a set of related user accounts that can share access to a file or directory.
Important points:
A user can be participant 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 when a user  was not  member can only change to that group if the group password exist and the user gives it.
One or more users can become group administrators for specific groups.
Group Administrators can:
·         add/change/delete the password of the group
·        add/delete users to the group
·         reserve the group to members only
Types of groups
There are two types of groups. They are
Primary group: These groups are created automatically when user was created.
Secondary group: these groups are created by the admin manually.
The groups configuration files:
/etc/group: Where all the users for each groups are listed.

Read more

Friday, November 23, 2012

User Administration

User Administration



Every process on the system runs as a particular user.Every file is owned by a particular user.Access to files and directories are restricted by user.the user associated with the running process determines the files and directories accessible to that process
There are three different types of users are present in the linux .they are
Super user
Super user is a user who will have all the permissions over the system. He will have complete authority on the system.
Root user is the super user
System user
The users created during the installation of the operating system are known as super users.supers users are also created when we deploy any application or install any server
Normal user
These users are created manually
UID
user ID (UID) is a unique positive integer assigned by a Unix-like operating system to each user. Each user is identified to the system by its UID, and user names are generally used only as an interface for humans.
UID for:
Super user :0
Systemusers:1-499
Normal users:500-60,000

Read more

Thursday, November 22, 2012

Partition

 Partition


Partitioning is a means to divide a single hard drive into many logical drives. A partition is contiguous set of blocks on a drive that are treated as an independent disk.
Purpose of partition
Ease of use - Make it easier to recover a corrupted file system or operating system installation.
Performance - Smaller file systems are more efficient. You can tune file system as per application such as log or cache files. Dedicated swap partition can also improve the performance (this may not be true with latest Linux kernel 2.6).
Security - Separation of the operating system files from user files may result into a better and secure system. Restrict the growth of certain file systems is possible using various techniques.
Backup and Recovery - Easier backup and recovery.
Stability and efficiency - You can increase disk space efficiency by formatting disk with various block sizes. It depends upon usage. For example, if the data is lots of small files, it is better to use small block size.
Testing - Boot multiple operating systems such as Linux, Windows and FreeBSD from a single hard disk.

Types of partition
There are three types of partions are there .they are
Primary
A primary partition may contain an operating system along with any number of data files (for example, program files, user files, and so forth). Before an OS is installed, the primary partition must be logically formatted with a file system compatible to the OS. If you have multiple primary partitions on your hard disk, only one primary partition may be visible and active at a time. The active partition is the partition from which an OS is booted at computer startup. Primary partitions other than the active partition are hidden, preventing their data from being accessed. Thus, the data in a primary partition can be accessed (for all practical purposes) only by the OS installed on that partition.
If you plan to install more than one operating system on your hard disk, you probably need to create multiple primary partitions; most operating systems can be booted only from a primary partition.
Extended

An extended partition does not directly hold data. You must create logical partitions within the extended partition in order to store data. Once created, logical partitions must be logically formatted, but each can use a different file system.
Logical Partition
Logical partitions is partition that are created inside the extended partition
Partition Creation
 fdisk command is used to create a partition
d:deleate a partition
n:add a new partition
p:print partition table
q:quit without saving changes
w:write table to disk and exit
t:to select the type of partition
partprobe command is used to update the partition table
mkfs.<filesystem name>:used to format filesystem
mount <partition> <directory name> to mount the directory
 umount <directory name> to unmount the directory
Note: we have to use /etc/fstab to mount partition permanently
Example:

[root@raju]#vi /etc/fstab
/dev/sda4   /raju  ext4     defaults  0 0
[root@raju]#fdisk /dev/sda
command(mfor help):n
First cylinder (36495-38913, default 36495):
Using default value 36495
Last cylinder, +cylinders or +size{K,M,G} (36495-38913, default 38913): +100M
Command (m for help): w 
[root@raju]#partx -a   /dev/sda
[root@raju]#mkfs.ext4 /dev/sda5
[root@raju]#mkdir /raju
[root@raju]#vi /etc/fstab
/dev/sda4   /raju  ext4     defaults  0 0




Read more

LVM



Logical Volume Manager (LVM)
LVM is a method of allocating hard drive space into logical volumes that can be easily resized instead of partitions.With LVM, the hard drive or set of hard drives is allocated to one or more physical volumes. A physical volume can not span over more than one drive. 
The physical volumes are combined into logical volume groups, with the exception of the /boot/ partition. The /boot/ partition can not be on a logical volume group because the boot loader can not read it. If the root / partition is on a logical volume, create a separate /boot/ partition which is not a part of a volume group.
Since a physical volume can not span over more than one drive, to span over more than one drive, create one or more physical volumes per drive. 



The logical volume group is divided into logical volumes, which are assigned mount points such as /home and / and file system types such as ext3. When "partitions" reach their full capacity, free space from the logical volume group can be added to the logical volume to increase the size of the partition. When a new hard drive is added to the system, it can be added to the logical volume group, and the logical volumes that are the partitions can be expanded.

Some of useful commands in LVM creation
1.      pvcreate is used to create physical volume group
2.      vgcreate is used to create volume group
3.      lvcreate is used to create logical volume
4.      lvresize is used to resize the the logical volume
5.      resize2fs is used to update the resized volume
6.      vgextend is used to extend the size of volume group
Example to create LVM
To accomplish this task you must be login form root account. So first login from root and verify your hard disk status with fdisk –l command ( This command will show that where your hard disk is mounted. You should use the mount point which show in the output of this command. For example if you see /dev/hda then you should use fdisk /dev/hda in next command. Or if you see /dev/sdb then you should use fdisk /dev/sdb in next command.
 [root@raju]#fdisk /dev/sda
  command(mfor help):n
  command(mfor help):e
First cylinder ("36495-38913", default 36495):
Using default value 36495
Last cylinder, +cylinders or +size{K,M,G} ("3649538913", default 38913): +100M
 Command (m for help):t
 Command (m for help): 8e
 Command (m for help): w
[root@raju]#Partx -a  /dev/sda
[root@raju]#pvcreate /dev/sda5
[root@raju]#vgcreate  -s 25M Cisco /dev/sda4  #creates volume group named Cisco
[root@raju]#lvcreate   - l 4 –n CCNA Cisco #creates 4 extends of volume group 25mb

   [root@raju]#mkfs.ext4 /dev/mapper/Cisco
   [root@raju]#mkdir /raju
   [root@raju]#vi /etc/fstab
   /dev/Cisco/CCNA  /raju  ext4     defaults  0 0



Read more