Slide

  • LINUX

    LINUX:In 1969 AT&T made a decision to withdraw Multics and go with GECOS (General Electric Comprehensive Operating Supervisor / System), with AT & T in Bells Lab when Multics was withdrawn some of the programmers named Ken Thompson and Dennis Ritchie decided to rewrite operating system in order to support low cost computer..To Know More

    CLICK HERE

  • MICROSOFT

    MICROSOFT:Microsoft was established to develop and sell BASIC interpreters for the Altair 8800. It rose to dominate the home computer operating system market with MS-DOS in the mid-1980s,followed by the Microsoft Windows line of operating systems. To Know More

    CLICK HERE

  • CISCO

    CISCO:During the early 1980s, there was a married couple namely Len and Sandy Bosack who used to work in two different departments of computer located in Stanford University. This couple was facing problem in making their computers communicate with each other To Know More

    CLICK HERE

showinfo=1

Disk Quota


Disk Quota


Disk Quotas are used to limit a user's or a group of users' ability to consume disk space. This prevents a small group of users from monopolizing disk capacity and potentially interfering with other users or the entire system.Disk quotas are commonly used by ISPs, by Web hosting companies, on FTP sites, and on corporate file servers to ensure continued availability of their systems. Using disk quota administrator can restrict user in two ways :-

1. Restricting user or group by creating files in a specific location.
2. Restricting user or group by the disk space in a specific location.

Disk Quota Terms

1. Soft Link = Disk space a user can use
2. Hard Link = Absolute limit a user can use
3. Grace Periods = Time duration till user can use hard limit space
4. 1 inode = 1KB
5. dd = used to create a blank file of specific size
6. required RPM = quata-*
7. /etc/fstab option = userquota, grpquota
8. Quota files = aquota.user. aquota.group
9. Necessary Commands = mount, quotarun, quotacheck, edquota, quotaoff, quotaon

1. To set quota on user.

[root@server1 ~]#useradd usr1
[root@server1~]# passwd usr1
Changing password for user username.
New password: * * * * *
BAD PASSWORD: it is based on a directory word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication token updated successfully.

[root@server1 ~]#vi /etc/fstab
UUID=2f3r7yf8-bd9h-56tf-h8gt-45df12g74fdv  /home  ext4  defaults,usrquota  1 2

:wq!


[root@server1 ~]#mount
/dev/sda5 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda7on /home type ext4 (rw)
/dev/sda8 on /tmp type ext4 (rw)
/dev/sda2 on /usr type ext4 (rw)
/dev/sda3 on /var type ext4 (rw)
/dev/sda9 on /example type ext4 (rw)

[root@server1 ~]#mount -o remount /home
[root@server1 ~]#mount
dev/sda5 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda7on /home type ext4 (rw,usrquota)
/dev/sda8 on /tmp type ext4 (rw)
/dev/sda2 on /usr type ext4 (rw)
/dev/sda3 on /var type ext4 (rw)
/dev/sda9 on /example type ext4 (rw)
[root@server1 ~]#touch /home/aquota.user
[root@server1 ~]#quotacheck -vc /home
[root@server1 ~]#repquota -a

Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32   0      0      8         0     0       0 
usr2 -- 32   0      0      8         0     0       0
usr3 -- 32   0      0      8         0     0       0

[root@server1 ~]#quotacheck -vc /home
[root@server1 ~]#quotaon -v /home
[root@server1 ~]#setquota –u usr1 256 512 0 0 /home
Username Mini Maxi Mini Maxi Mount Point
Block Block File File to set Quota
Limit Limit Limit Limit
[root@server1 ~]#repquota -a

Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32 256   512   8         0     0       0
usr2 -- 32   0      0      8         0     0       0
usr3 -- 32   0      0      8         0     0       0

[root@server1 ~]#

Now login with that user3 from another console.
CTRL+ALT+F2
Server1 Login : usr1
Password: ******  


[use3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.000875702 s, 117 MB/s

[use3@server1 ~]$ll
-rw-rw-r--. 1 usr1 usr1 102400 Jun 20 07:05 file1
[use3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=300
300+0 records in
300+0 records out
307200 bytes (307 kB) copied, 0.0142128 s, 21.6 MB/s

[use3@server1 ~]$ll
-rw-rw-r--. 1 usr1 usr1 307200 Jun 20 07:05 file1
[use3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=500
Dd: writing ‘file1’ : Disk quota exceeded
477+0 records in
476+0 records out
487424 bytes (487 kB) copied, 0.0057277 s, 85.1 MB/s

[use3@server1 ~]$ll
-rw-rw-r--. 1 usr1 usr1 487424 Jun 20 07:05 file1
[use3@server1 ~]$

CTRL+D ……..to log out from usr1

Server1 Login :root
Password: ******  


[root@server1 ~]#repquota -a
Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32 256   512 6days    0     0       0
usr2 -- 32   0      0      8         0     0       0
usr3 -- 32   0      0      8         0     0       0

2. To set same quota limit on multiple user.

[root@server1 ~]#useradd usr2
[root@server1~]# passwd usr2
Changing password for user username.
New password: * * * * *
BAD PASSWORD: it is based on a directory word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication token updated successfully.

 [root@server1 ~]#useradd usr3
[root@server1~]# passwd usr3
Changing password for user username.
New password: * * * * *
BAD PASSWORD: it is based on a directory word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication token updated successfully.

[root@server1 ~]#vi /etc/fstab
UUID=2f3r7yf8-bd9h-56tf-h8gt-45df12g74fdv /home ext4 defaults,usrquota 1 2

:wq!


[root@server1 ~]#mount
/dev/sda5 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda7on /home type ext4 (rw)
/dev/sda8 on /tmp type ext4 (rw)
/dev/sda2 on /usr type ext4 (rw)
/dev/sda3 on /var type ext4 (rw)
/dev/sda9 on /example type ext4 (rw)

[root@server1 ~]#mount -o remount /home
[root@server1 ~]#mount
dev/sda5 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda7on /home type ext4 (rw,usrquota)
/dev/sda8 on /tmp type ext4 (rw)
/dev/sda2 on /usr type ext4 (rw)
/dev/sda3 on /var type ext4 (rw)
/dev/sda9 on /example type ext4 (rw)
[root@server1 ~]#touch /home/aquota.user
[root@server1 ~]#quotacheck -vc home
[root@server1 ~]#repquota -a

Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32   0      0      8         0     0       0 
usr2 -- 32   0      0      8         0     0       0
usr3 -- 32   0      0      8         0     0       0

[root@server1 ~]#quotacheck -vc /home
[root@server1 ~]#quotaon -v /home
/dev/sda7 [/home]: user quotas turned on
[root@server1 ~]#setquota –u usr2 256 512 0 0 /home

Username Mini Maxi Mini Maxi Mount Point
Block Block File File to set Quota
Limit Limit Limit Limit

[root@server1 ~]#edquota –p usr2 usr3

Username another
to whome userto
quota is set same
set quota as user2

[root@server1 ~]#repquota -a

Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32   0      0      8         0     0       0 
usr2 -- 32   256  512  8         0     0       0
usr3 -- 32   256  512   8         0     0       0

[root@server1 ~]#

Now login with that usr2 from another console.
CTRL+ALT+F2
Server1 Login : usr2
Password: ******
[usr2@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.000875702 s, 117 MB/s


[usr2@server1 ~]$ll
-rw-rw-r--. 1 usr2 usr2 102400 Jun 20 07:05 file1
[usr2@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=300
300+0 records in
300+0 records out
307200 bytes (307 kB) copied, 0.0142128 s, 21.6 MB/s

[usr2@server1 ~]$ll
-rw-rw-r--. 1 usr2 usr2 307200 Jun 20 07:05 file1
[usr2@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=500 ………
Dd: writing ‘file1’ : Disk quota exceeded
477+0 records in
476+0 records out
487424 bytes (487 kB) copied, 0.0057277 s, 85.1 MB/s


[usr2@server1 ~]$ll
-rw-rw-r--. 1 usr2 usr2 487424 Jun 20 07:05 file1

[use2@server1 ~]$

CTRL+D ……..to log out from usr2

Now login with that usr3.
Server1 Login : usr3
Password: ******  


[usr3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.000875702 s, 117 MB/s

[usr3@server1 ~]$ll
-rw-rw-r--. 1 usr3 usr3 102400 Jun 20 07:05 file1
[use3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=300
300+0 records in
300+0 records out
307200 bytes (307 kB) copied, 0.0142128 s, 21.6 MB/s

[usr3@server1 ~]$ll
-rw-rw-r--. 1 usr3 usr3 307200 Jun 20 07:05 file1
[usr3@server1 ~]$dd if=/dev/zero of=file1 bs=1K count=500
Dd: writing ‘file1’ : Disk quota exceeded
477+0 records in
476+0 records out
487424 bytes (487 kB) copied, 0.0057277 s, 85.1 MB/s

[usr3@server1 ~]$ll
-rw-rw-r--. 1 usr3 usr3 487424 Jun 20 07:05 file1
[usr3@server1 ~]$

CTRL+D ……..to log out from usr3

Now login with root.
Server1 Login : root
Password: ******
[root@server1 ~]#repquota -a
Block Limits File Limits
User used soft hard grace used soft hard grace
root -- 24    0      0      3        0     0      0
cms -- 36    0      0      9         0     0      0
usr1 -- 32   0      0      8         0     0       0 
usr2 -- 32   256  512  6days  0     0       0
usr3 -- 32   256  512  6days  0     0       0




SAMBA Server And Client Config


SAMBA Server And Client Config


Samba is a software package that comes with RHEL 6.0 that lets you share file systems and printers on a network with computers that use the Session Message Block (SMB) protocol. SMB is the protocol that is delivered with Windows operating systems for sharing files and printers
You can do four basic things with Samba:
Share a Linux directory tree with Windows and Linux/Unix computers
Share a Windows directory with Linux/Unix computer0073
Share a Linux printer with Windows and Linux/Unix computers
Share a Windows printer with Linux/Unix computers

Configurations Files

1. /etc/samba/smb.conf- Main Configuration File

1. Configurations Samba Server.



[root@server1 ~]# yum install samba*
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package samba-common-3.5.4-68.el6.i686 already installed and latest version
Package samba-winbind-clients-3.5.4-68.el6.i686 already installed and latest version
Package samba-client-3.5.4-68.el6.i686 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package samba.i686 0:3.5.4-68.el6 set to be updated
---> Package samba-winbind.i686 0:3.5.4-68.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================
Package Arch Version Repository Size
===========================================================================
Installing:
samba i686 3.5.4-68.el6 Server 5.0 M
samba-winbind i686 3.5.4-68.el6 Server 3.5 M

Transaction Summary
===========================================================================
Install 2 Package(s)
Upgrade 0 Package(s)

Total download size: 8.5 M
Installed size: 30 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): samba-3.5.4-68.el6.i686.rpm | 5.0 MB 00:00
(2/2): samba-winbind-3.5.4-68.el6.i686.rpm | 3.5 MB 00:00
--------------------------------------------------------------------------------
Total 6.4 MB/s | 8.5 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : samba-winbind-3.5.4-68.el6.i686 1/2
Installing : samba-3.5.4-68.el6.i686 2/2

Installed:
samba.i686 0:3.5.4-68.el6 samba-winbind.i686 0:3.5.4-68.el6
Complete!
[root@server1 ~]#vi /etc/samba/smb.conf
:se nu
Line No. 74
workgroup = MYGROUP

change this line as follow
workgroup = workgroup

Line No. 289
Add this lines
[Kavi]
comment = sam ram
path = /kavi
public = yes
writable = yes
printable =no


:wq!
[root@server1 ~]# useradd u1
[root@server1 ~]# passwd u1
Changing password for user u1.
New password: * * * * * (u1)
BAD PASSWORD: it is WAY too short
BAD PASSWORD: is too simple
Retype new password: * * * * *(u1)
passwd: all authentication tokens updated successfully.


Adding normal user has samba user.
[root@server1 ~]# smbpasswd  -a u1
New SMB password:* * * * * (u1@123)
Retype new SMB password:* * * * *(u1@123)
Added user u1.

enabling u1 user has samba user.
[root@server1 ~]# smbpasswd  -e u1
[root@server1 ~]# servicesmb restart
Shutting down SMB services: [ FAILED ]
Starting SMB services: [ OK ]
[root@server1 ~]#chkconfig--level 35 smb on

1.Configurations Samba Client (on windows).
Go to Start-Run-\\200.0.0.1\
type username and password
username - u1
password - *****(u1@123)

Now your are able to access kavi directory and files from it & user u1 home directory as well.

2. Configurations Samba Server without sharing samba user’s home directory.
To hide home directory of Samba User
[root@server1 ~]#vi /etc/samba/smb.conf
:se nu

Line No . 248
[homes]
comment = Home Directories
browesable = no
; valid users = %S
; valid users = MYDOMAIN\%S

Modify this line as follow
;[homes]
; comment = Home Directories
; browesable = no
; valid users = %S
; valid users = MYDOMAIN\%S


:wq!
[root@server1 ~]# servicesmb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]

2.Configurations Samba Client (on windows).



Go to Start-Run-\\200.0.0.1\
type username and password
username - u1
password - *****

Now your are able to see user’s home directory of user u1.

NFS (Network File System)


NFS (Network File System)


A Network File System (NFS) allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network. The Network File System (NFS) is the standard for sharing files on a directory with Linux and Unix computers. It was originally developed by Sun Microsystems in the mid-1980s.
You can create shared NFS directories directly by editing the /etc/exports configuration file, or you can create them with Red Hat's NFS Configuration tool.

Configurations Files


1. /etc/exports - Main Configuration File

1. Configurations NFS Server.

[root@server1 ~]# yum install nfs*
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.i686 1:1.2.2-7.el6 set to be updated
---> Package nfs-utils-lib.i686 0:1.1.5-1.el6 set to be updated
---> Package nfs4-acl-tools.i686 0:0.3.3-5.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================== Package Arch Version Repository Size
===========================================================================
Installing:
nfs-utils i686 1:1.2.2-7.el6 Server 296 k
nfs-utils-lib i686 1.1.5-1.el6 Server 65 k
nfs4-acl-tools i686 0.3.3-5.el6 Server 43 k

Transaction Summary
===========================================================================
Install 3 Package(s)
Upgrade 0 Package(s)

Total download size: 404 k
Installed size: 989 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): nfs-utils-1.2.2-7.el6.i686.rpm | 296 kB 00:00
(2/3): nfs-utils-lib-1.1.5-1.el6.i686.rpm | 65 kB 00:00
(3/3): nfs4-acl-tools-0.3.3-5.el6.i686.rpm | 43 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------
Total 2.5 MB/s | 404 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:nfs-utils-1.2.2-7.el6.i686 1/3
Installing : nfs-utils-lib-1.1.5-1.el6.i686 2/3
Installing : nfs4-acl-tools-0.3.3-5.el6.i686 3/3

Installed:
nfs-utils.i686 1:1.2.2-7.el6 nfs-utils-lib.i686 0:1.1.5-1.el6 nfs4-acl-tools.i686 0:0.3.3-5.el6
Complete!

[root@server1 ~]# mkdir  /data
[root@server1 ~]# cd  /data
[root@server1 data]# ll
total 0
[root@server1 data]# touch file1 file2
[root@server1 data]# cat >> file1
Welcome
CTRL+D  


[root@server1 data]# ll
total 0
-rw-r--r-- 1 root root 8 Aug 8 13:26 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2
[root@server1 data]# chmod o+rw file1
[root@server1 data]# ll
total 4
-rw-r--rw- 1 root root 8 Aug 8 13:29 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2
[root@server1 ~]# vi /etc/exports

i and add following line in it to access data directory by everyone in the network

/data *(rw,sync)


:wq!  


[root@server1 ~]# service nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
Starting RPC idmapd: [ OK ]
[root@server1 ~]# chkconfig --level 35 nfs on
[root@server1 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data *

1. Configurations NFS Client.
[root@client ~]# showmount –e 200.0.0.1
Export list for 200.0.0.1:
/data *
[root@client ~]# mount 200.0.0.1:/data /mnt
[root@client ~]# cd /mnt
[root@client mnt]# ll
total 0
-rw-r--r-- 1 root root 0 Aug 8 13:26 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2
[root@client mnt]# cat >> file1
bash: file1: Permission denied
[root@client mnt]# ll
total 4
-rw-r--rw- 1 root root 8 Aug 8 13:29 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2
[root@client mnt]# cat >> file1
welcome
to  ITTables
CTRL+D
[root@clientmnt]# cat file1
welcome
to ITTables
[root@clientmnt]# vi file1
i
welocme to ITTables


:wq!
[root@client mnt]# cat file1
welcome to ITTables




2. Configurations NFS Server to share directory for specific client .





[root@server1 ~]# vi /etc/exports

i and add following line in it to access data directory only by specific ip address in the network i.e. 200.0.0.40

/data 200.0.0.40(rw,sync)


:wq! …….
[root@server1 ~]# service nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@server1 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data 200.0.0.40

2. Configurations NFS Client.


[root@client2 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data 200.0.0.40
[root@client2 ~]# mount 200.0.0.1:/data /mnt
[root@client2 ~]# cd /mnt
[root@client2 mnt]# ll
total 0
-rw-r--r-- 1 root root 0 Aug 8 13:26 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2

[root@client1 ~]# mount 200.0.0.1:/data /mnt
cannot open directory .: Permission denied



3. Configurations NFS Server to share directory for clients in a specific network.



[root@server1 ~]# vi /etc/exports


/data 200.0.0.0/24(rw,sync)


:wq!
[root@server1 ~]# service nfsrestart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@server1 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data 200.0.0.0/24





3. Configurations NFS Client.





[root@client1 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data 200.0.0.0/24
[root@client1 ~]# mount 200.0.0.1:/data /mnt
[root@client1 ~]# cd /mnt
[root@client mnt]# ll
total 0
-rw-r--r-- 1 root root 0 Aug 8 13:26 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2

[root@client2 ~]# showmount -e 200.0.0.1
Export list for 200.0.0.1:
/data 200.0.0.0/24
[root@client2 ~]# mount 200.0.0.1:/data /mnt
[root@client2 ~]# cd /mnt
[root@client mnt]# ll
total 0
-rw-r--r-- 1 root root 0 Aug 8 13:26 file1
-rw-r--r-- 1 root root 0 Aug 8 13:26 file2

Telnet Server And Client Config


Telnet Server And Client Config


Telnet server is used to login into another system. You can use the telnet command to log in remotely to another system on your network. The system can be on your local area network or available through an Internet connection.Telnet operates as if you were logging in to another system from a remote terminal. You will be asked for a login name and password. In effect, you are logging in to another account on another system. In fact, if you have an account on another system, you could use Telnet to log in to it.


Configurations Files

1. /etc/xinetd.d/telnet - Main Configuration File.

2. /etc/securetty - Contains list of the consoles allow to access for users to used log in remotely to another system.

3. /etc/hosts - Contains list of IP address allow to access telnet session from another systems.


Configuring Telnet Server.



[root@server1 ~]# yum install telnet*        …….
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Server | 1.3 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.i686 1:0.17-46.el6 set to be updated
---> Package telnet-server.i686 1:0.17-46.el6 set to be updated
--> Processing Dependency: xinetd for package: 1:telnet-server-0.17-46.el6.i686
--> Running transaction check
---> Package xinetd.i686 2:2.3.14-29.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================
Package Arch Version Repository Size
===========================================================================
Installing:
telnet i686 1:0.17-46.el6 Server 56 k
telnet-server i686 1:0.17-46.el6 Server 36 k
Installing for dependencies:
xinetd i686 2:2.3.14-29.el6 Server 121 k

Transaction Summary
===========================================================================
Install 3 Package(s)
Upgrade 0 Package(s)

Total download size: 213 k
Installed size: 409 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): telnet-0.17-46.el6.i686.rpm | 56 kB 00:00
(2/3): telnet-server-0.17-46.el6.i686.rpm | 36 kB 00:00
(3/3): xinetd-2.3.14-29.el6.i686.rpm | 121 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------
Total 5.2 MB/s | 213 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2:xinetd-2.3.14-29.el6.i686 1/3
Installing : 1:telnet-server-0.17-46.el6.i686 2/3
Installing : 1:telnet-0.17-46.el6.i686 3/3

Installed:
telnet.i686 1:0.17-46.el6 telnet-server.i686 1:0.17-46.el6

Dependency Installed:
xinetd.i686 2:2.3.14-29.el6
Complete!


[root@server1 ~]#vi /etc/xinetd.d/telnet    …….
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure + = USERID
disable = yes
}

and modify this as follow

# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure + = USERID
disable = no
}


:wq!           …….



[root@server1 ~]# vi /etc/securetty       …….
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11

and modify this as follow
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
pts/0
pts/1
pts/2


:wq!     …….



[root@server1 ~]#vi /etc/hosts …….
add client's and own machine ip adsress

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
200.0.0.1
200.0.0.100



:wq! …….

[root@server1 ~]# service xinetd restart …….
Stopping xinetd: [FAILED]
Starting xinetd: [ OK ]
[root@server1 ~]# chkconfig --level 35 xinetd on …….




Configuring Telnet Client.

[root@client ~]# yum install telnet …….
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Client | 1.3 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.i686 1:0.17-46.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================
Package Arch Version Repository Size
===========================================================================
Installing:
telnet i686 1:0.17-46.el6 Client 56 k

Transaction Summary
===========================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 56 k
Installed size: 102 k
Is this ok [y/N]: y
Downloading Packages:
telnet-0.17-46.el6.i686.rpm | 56 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 1:telnet-0.17-46.el6.i686 1/1

Installed:
telnet.i686 1:0.17-46.el6
Complete!


[root@client Desktop]# telnet 200.0.0.1  …….
Trying 200.0.0.1...
Connected to 200.0.0.1.
Escape character is '^]'.
Red Hat Enterprise Linux Server release 6.0 (Santiago)
Kernel 2.6.32-71.el6.i686 on an i686
login: root …….
Password: * * * * * …….
Last login: Sat May 20 20:32:31 on pts/2


[root@server1 ~]# ll …….
total 112
drwxr-xr-x. 11 root root 4096 May 20 21:19 1
-rw-------. 1 root root 1500 Jan 1 2013 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 May 20 20:46 Desktop
drwxr-xr-x. 2 root root 4096 May 22 2011 Documents
drwxr-xr-x. 2 root root 4096 May 22 2011 Downloads
-rw-r--r--. 1 root root 45367 Jan 1 2013 install.log
-rw-r--r--. 1 root root 10565 Jan 1 2013 install.log.syslog
drwxr-xr-x. 2 root root 4096 May 22 2011 Music
-rw-r--r-- 1 root root 21 May 20 22:33 new1
drwxr-xr-x. 2 root root 4096 May 22 2011 Pictures
drwxr-xr-x. 2 root root 4096 May 22 2011 Public
drwxr-xr-x. 2 root root 4096 May 22 2011 Templates
drwxr-xr-x. 2 root root 4096 May 22 2011 Videos
-rw-r--r-- 1 root root 0 May 20 2000 welcome

[root@server1 ~]# rm-rf welcome …….


[root@server1 ~]# ll …….
drwxr-xr-x. 11 root root 4096 May 20 21:19 1
-rw-------. 1 root root 1500 Jan 1 2013 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 May 20 20:46 Desktop
drwxr-xr-x. 2 root root 4096 May 22 2011 Documents
drwxr-xr-x. 2 root root 4096 May 22 2011 Downloads
-rw-r--r--. 1 root root 45367 Jan 1 2013 install.log
-rw-r--r--. 1 root root 10565 Jan 1 2013 install.log.syslog
drwxr-xr-x. 2 root root 4096 May 22 2011 Music
-rw-r--r-- 1 root root 21 May 20 22:33 new1
drwxr-xr-x. 2 root root 4096 May 22 2011 Pictures
drwxr-xr-x. 2 root root 4096 May 22 2011 Public
drwxr-xr-x. 2 root root 4096 May 22 2011 Templates
drwxr-xr-x. 2 root root 4096 May 22 2011 Videos

[root@server1 ~]#cat > new …….
Welcome to ITTables …….
CTRL+D …….
[root@server1 ~]#ll …….
drwxr-xr-x. 11 root root 4096 May 20 21:19 1
-rw-------. 1 root root 1500 Jan 1 2013 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4096 May 20 20:46 Desktop
drwxr-xr-x. 2 root root 4096 May 22 2011 Documents
drwxr-xr-x. 2 root root 4096 May 22 2011 Downloads
-rw-r--r--. 1 root root 45367 Jan 1 2013 install.log
-rw-r--r--. 1 root root 10565 Jan 1 2013 install.log.syslog
drwxr-xr-x. 2 root root 4096 May 22 2011 Music
-rw-r--r-- 1 root root 21 May 20 22:33 new1
drwxr-xr-x. 2 root root 4096 May 22 2011 Pictures
drwxr-xr-x. 2 root root 4096 May 22 2011 Public
drwxr-xr-x. 2 root root 4096 May 22 2011 Templates
drwxr-xr-x. 2 root root 4096 May 22 2011 Videos
-rw-r--r-- 1 root root 0 May 20 2000 welcome
[root@server1 ~]# exit …….
Logout
Connection closed by foreign host.

[root@client ~]# telnet 200.0.0.1 …….
Trying 200.0.0.1...
Connected to 200.0.0.1.
Escape character is '^]'.
Red Hat Enterprise Linux Server release 6.0 (Santiago)
Kernel 2.6.32-71.el6.i686 on an i686
login: user1 …….
Password:***** …….
Last login: Sat May 20 23:08:34 from 200.0.0.2
[user1@server1 ~]$

Setup Your Own CLoud Server in Linux


Setup Your Own CLoud Server in Linux


#cd /etc/yum.repos.d

#wget   http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo

#yum install owncloud

It will automatically install dependencies, such as Apache, PHP, and MySQL. Once the installation is complete, you can point your browser to http://yourdomain/owncloud and start the “First Run Wizard”.

Enter a username and password for your administrative account
If SQLite is detected, ownCloud will use it by default. Alternatively, you can enter your MySQL database information in the “Advanced” section.

Note :- Need to create a database for it

e.g

#mysql  -u  root  -p

mysql>create database owncloud;
mysql>quit;


enter the username and password of the database in the advance option.


   Finish The setup


    Login with username and password you just created






ownCloud gives you the freedom to use the cloud on your terms however you want. You can access your files from anywhere, just as you would with a proprietary cloud service, but the files and software are yours. You will not have to worry about privacy or the safety of your data.



Open Source Linux Server Provisioning Software


Open Source Linux Server Provisioning Software


Server provisioning is nothing but load the Linux or UNIX like operating systems automatically with actual operating systems, device drivers, data, and make a server ready for network operation without any user input. Typically you select a server from a pool of available servers, load the operating systems (such as RHEL, Fedora, FreeBSD, Debian), and finally customize storage, network (IP, gateway, bounding etc), drivers, applications, users etc. Using the following tools you can perform automated unattended operating system installation, configuration, set virtual machines and much more. These software can be used to install a lot (say thousands) of Linux and UNIX systems at the same time.


1) Kickstart
From the official Redhat guide:
Many system administrators would prefer to use an automated installation method to install Red Hat / CentOS / Fedora Linux on their machines. To answer this need, Red Hat created the kickstart installation method. Using kickstart, a system administrator can create a single file containing the answers to all the questions that would normally be asked during a typical Red Hat Linux installation. Kickstart provides a way for users to automate a Red Hat Enterprise Linux installation.
Kickstart Configurator allows you to create or modify a kickstart file using a graphical user interface, so that you do not have to remember the correct syntax of the file.



Official Links :-  Kickstart Installations
                          

2) Fully Automatic Installation (FAI)
AI is a non-interactive system to install, customize and manage Linux systems and software configurations on computers as well as virtual machines and chroot environments, from small networks to large-scale infrastructures and clusters. It is a tool for fully automatic installation of Debian and other Linux Distributions such as Suse, Redhat, Solaris via network, custom install cd, or into a chroot environment. Some people also use it to install Windows.
FAI Features
1. Installs and updates Debian, Ubuntu, SuSe, RHEL, CentOS, Fedora, Mandriva, Solaris, etc
2. Centralized deployment and configuration management
3. Integrated disaster recovery system
4. Easy set up of software RAID and LVM
5. Installs XEN domains, VirtualBox and Vserve
6. Every stage can be customized via hooks
7. Full remote control via ssh during installation

Official Links :- Fully Automatic Installation

3) Cobbler

Cobbler is a Linux provisioning server that centralizes and simplifies control of services including DHCP, TFTP, and DNS for the purpose of performing network-based operating systems installs. It can be configured for PXE, reinstallations, and virtualized guests using Xen, KVM or VMware. Again it is mainly used by Redhat and friends, but you can configure a PXE server to boot various non-RPM boot images such as Knoppix and other flavors of Debian such as Ubuntu.
There is also a lightweight built-in configuration management system, as well as support for integrating with configuration management systems like Puppet. Cobbler has a command line interface, a web interface, and also several API access options.


Official Links :- Cobbler Installation


4) Spacewalk

Spacewalk is an open source (GPLv2) Linux systems management solution. It is the upstream community project from which the Red Hat Network Satellite product is derived. Spacewalk manages software content updates for Red Hat derived distributions such as Fedora, CentOS, and Scientific Linux, within your firewall. You can stage software content through different environments, managing the deployment of updates to systems and allowing you to view at which update level any given system is at across your deployment. A clean central web interface allows viewing of systems and their software update status, and initiating update actions.
Features:
1. Inventory your systems (hardware and software information)
2. Install and update software on your systems
3. Collect and distribute your custom software packages into manageable groups
4. Provision (kickstart) your systems
5. Manage and deploy configuration files to your systems
6. Monitor your systems
7. Provision and start/stop/configure virtual guests
8. Distribute content across multiple geographical sites in an efficient manner.



Official Links :- Spacewalk Guide


5) OpenQRM

openQRM is the next generation, open-source Data-center management platform. Its fully pluggable architecture focuses on automatic, rapid- and appliance-based deployment, monitoring, high-availability, cloud computing and especially on supporting and conforming multiple virtualization technologies. openQRM is a single-management console for the complete IT-infra structure and provides a well defined API which can be used to integrate third-party tools as additional plugins.
Features
1. Complete separation of "hardware" (physical servers and virtual machines) from "software" (server-images)
Support for different virtualization technologies
2. Fully automatic Nagios configuration (single click) to monitor all systems and services
3. High-availability : "N to 1" fail-over
4. Integrated storage management
5. Distribution support - openQRM 4.x comes with a solid support for different linux distribution like Debian, Ubuntu, CentOS and openSuse. A single openQRM server can manage the provisioning of servers from those different linux distributions seamlessly.

Official Links :- Openqrm Guide

Linux Script To Check Disk Space


Linux Script To Check The Disk Space and Send Mail if Limit Crossed.



we will create a script which will check the / disk space and send a mail if it crosses 80% of disk usage.

#cd  /scripts
#vi  diskspace.sh

#!/bin/bash
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=80

if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
mail -r  diskreport@ittables.com  -s 'Disk Space Alert' admin@ittables.com << EOF
Your /  partition remaining free space is critically low. Used: $CURRENT%
EOF
fi


save and exit

#chmod  +x  diskspace.sh

For periodic check that is daily to run this script i.e every 6 hrs

#crontab  -e

*  */6  *  *  *  /scripts/diskspace.sh

save and exit


Now the above script will run in every 6 hrs

Note:- to mail stuff postfix or sendmail should be configured properly.




Linux Script To Check Service


linux script to check if a service is running and start it, if it’s stopped



We will use this script to check squid service is runing or not if not runing it will start it automatically and send a mail to admin. we will run this script every 20 min using cron.

you need to create a directory so we can log things into that directory.

#mkdir  /var/log/scripts

#cd  /scripts
#vi service.sh

#!/bin/bash
service=squid
log=/var/log/scripts/servicesh.log
date=$(date)

if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 ))
then
echo "$service is running!!! $date" > $log
else
echo "$service is not runing starting automatically $date" >> $log
/etc/init.d/$service start >> $log
mail -r proxy-1@ittables.com -s "Squid Service Status $date" "admin@ittables.com" < $log
fi


save the file and exit

#chmod +x service.sh

#crontab  -e

*/20  *  *  *  *  /scripts/service.sh

save and exit

Bow the above script will run in every 20min

Note:- to mail stuff postfix or sendmail should be configured properly.


For Latest Updates: Subscribe Now | | Test Your Knowledge, Take a Quiz now Click Here | | Site Best Viewed In Firefox

X