Showing posts with label FEDORA. Show all posts

GROUP QUOTA IN LINUX



GROUP QUOTA

GROUP QUOTA ___ means to apply the quota on the users of a particular group so that they can
                                      Use only the limited resources like
                            
                                      They can use assigned amount of space on the hard drive
                             Or      they can make only assigned amount of files on his particular directory.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
No more files no more space
If a single user use the all limits then other users can do nothing not can make files and not modify there files to big files because they have not the space to expend there files.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Now how to do __________________________________________________________________

1_To apply quota on a group we have the knowledge of all group permissions to apply them also.
                   
          # fdisk /dev/sda
          # ( commnd ( m for help))   n    -------- new partition.
          # rm   -rf   /dev/fd0 _______ disable floppy
          # partprobe ____________ refresh mounting point
         

          # mke2fs  -j /dev/sda5 ___________ format the new partition     


2_ we have to make a partition and then make a directory mount permanently this partition with
          That directory in the fstab file.
         
          # vi /etc/fstab_________________ fstab file open
         

          /dev/sda5    /data                    ext3            defaults,grpquota    0 0
         

         
:wq!
___________save n exit
                                                                            LOOK HERE IMPORTANT STEP}
                                                                  

          # mount   -a _______ refresh mounting point.
          #df    -TH __________ check for the mounted partition


3_ now make a group in the system. Which is used for the group quota?

          # groupadd sales_________to add a group.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



  
Now if we apply the permissions on the {/data} directory or on the group using group ids then all permissions will be applied on the users whose are under the groups.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

4_now change the directory which is mounted, as a directory of the group.

          # chgrp  sales   /data ________ now the directory of the group is the /data directory.

5_  now to give the permissions to the directory.

          # chmod 3777  /data _________ to /data directory permissions.

                                Group  users level security
                        Security here is the sgid and stickbit permissions are applied on the group by the administrator.

Group level securities are applied as a first bit of the security equations
Suid =4
Sgid =2
Stickbit=1



6_ now to check if the quota is been applied on this partition or is it ready for the quoata____

          # quotacheck    -g   /dev/sda5 ________ to check the quota on this partition.

If this command runs it means that it is able to apply the quota on this partition.

7_  now to activate the quota on this partition.

          # quotaon   -g  /dev/sda7 _________ now quota is on at this partition.


Now before editing the quota on this partition we have to add the users in this group there is a
Special method to add the new users in this group and as well as in the directory of the group
 So why if we apply the quota on the directory of the group it is applied indirectly on the all users of the group, and they have to follow the quota


POINT /___ point is here is that if there are four users in the  group and if only one is use all the limits of the quota mean if he cross the hard  limit of space usage or as well as the no of maximum files they all users can make then other users do nothing not can make a file or not even can modify there existing file because they have no additional space for the editing in the file, because only one of there partner is cross the all limits,. So they can do nothing.

8_ NOW HOW TO ADD USERS IN THE GROUP AS WELL AS IN THE DIRECTOTY ….

                   #useradd  -d   /data  {username} ___________ to add a user in this directory.
                   # passwd { username} __________ to give the password to the user.

                   We are attach this users to the directory but now  we have to make it the member of           group we made ___
         
          So to make it the member of this group there is  also a special command to add in group__


                   #usermod    -G  {groupname}    { username} _________ to add a user in the group.

                   Now this user is the member og the group as well as its hoem directory is  /data  now.
Remember to copy bash files from etc to that directory in which we made the users
          # cp /etc/skel/.bash*  /data ________________ to copy bash  files

9_  to check if the user is now the member of the group to check it open a special file in the /etc


          # vi  /etc/group ____________ the file contain the information of all groups in it ..
                                                          Shift+g __ to go to bottom of the file group is there  to see.


                                                                                                                  
10_ now to apply quota on the group we have to edit quota for the group________ as

          # edqouta    -g  {group name} ________ to edit quota for the group.


11_  to CHECK if the quota is been applied on the group

          # repquota   -avg _________ to check quota for the group.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



{{{ # poweroff }}} is also a command for shutdown remember it ok ______________

ENCRYPTING THE FILE



                                                #ENCRYPTING THE FILE#

NOW WE ARE GOING TO LEARN ABOUT THE ENCRYPTION IN THE LINUX.______

To ENCRYPT a file open this file in the [VIM] editor .that is must required for encryption.



Like I make a file name [gourav] in vim and add contents like
#vim gourav
My name is govam saddar.  Hay hallo to all use this notes. Bye.





:X___________________________________________type collons +capital [X]   on INSERT mode
Enter encryption key _ _ _ _ _ _ _ _ _
Retype the key _ _ _ _ _ _ _

Successfully done.

:wq!__________________    ________________to save n exit from the file .



Now this file is encrypted
CHECK it bye open in VI editor.

#vi gourav
@!%#$^!&^*(^(!)*_*!_(_&)@(^*!&#%@^#!&^$&I$@^&@$%@&$%@&$*%^!#*^#@


It will show thee encrypted form.


To show the encrypted file in decrypted mode
Open the file in VIM

# vim gourav

@#!$#^!%^!*&!)*^&(^!$@$!#^%!%*)@^!)*@#&^(!&*%#&^!$
E@^%!#$&^@#$


Enter encryption key _ _  _ _ _


But after save it again encrypt. so to make decrypt permanently.
TO MAKE A FILE DECRYPTED FORM___________________________________________

# vim gourav

@#!$#^!%^!*&!)*^&(^!$@$!#^%!%*)@^!)*@#&^(!&*%#&^!$
E@^%!#$&^@#$


Enter encryption key _ _  _ _ _



After put the key it will show u as the original file.

To break encryption after enter the encryption key



:set key=____enter _____________collon+set+space+key+=   to break the encryption



But must know the encryption password it mean who knows the password can only decrypt the file .

okkkk


DIRECTORY STRUCTURE OF LINUX



DIRECTORY STRUCTURE OF LINUX :-


·         /root :- Administrative user DIR when login through root user, the root users home directory. Some system related files or we can store data in this directory
·         /home :- Local user’s home DIR. Anyone can store data in this directory. We can use this directory as D:/
·         /etc :- All configuration files in this Dir file. System installation script, server configuration tools or all schedules in this directory.
·         /bin :- Local users and administrative user executable binary file.
·         /sbin :-only administrative users execute these binary files.
·         /var :- Printer  spooler. Log sheets (log creators)
·         /boot :- booting files, kernel images ( virtual kernel & permanent kernel). Grub boot loader file.
·         /proc :- information about hardware, device, CPU information, memory information.
·         /mnt :- temporary mount directory like CD-ROM, floppy.
·         /usr :- rpm – Linux. Red hat packet manager.
·         /tpm :- temporary files for 10 days.
·         /tft boot :- trival file transfer protocol
·         /dev :- it contains device drivers  files.
·         /opt :- it is for third party software.
·         /lost+found:-it acts as a recycle bin in the command mode and as a trash in The GUI mode.
·         /lib:- it contains the library a file of all software’s to open all software’s request is first gone to the /lib for open the application.
·          /temp:- it contains the all temporary files.

                          

HOW TO CONFIGUER DHCP SERVER IN RED HAT 6



DHCP SERVER CONFIGURATION

Dhcp server is used for to give automatic ip addresses in the network in which it is used………………

1_ automatic ip addressing.

2_ port no is {68}.

3_ main configuration file or the dhcp server is  {dhcpd.conf}  /////    {# vi /etc/dhcpd.conf}

4_ domain/service of dhcp to start is
               
        # service network restart ____________ to restart the service for the network.
        # service dhcpd restart _______________ to start the service of the dhcp server.

5_ installation packages  rpm`s____ are given in the installation { RHEL} DVD In the {


6_ to install the packages of the dhcp go to the directory in the dvd in which the rpm packages are then ..

        Run the command

        #rpm   -ivh  dhcp*    - - aid  - -  force _________ to install the packages from the dvd.
{redhat package }   {install vervosly}                              {forcefully}                  
    {manager}              {enhance}           
7_ to UPDATE the packages of the dhcp _________________”

        # rpm   -uvh   dhcp*    - -aid   - - force _____________ to update the packages  of dhcp.
                        {update}         

8_  to REMOVE the packages of the dhcp or any of the service___________________

        # rpm   -e  dhcp -3.0.5 _______ to erase the packages
                        {erase}


        { remember packages are to be erasing or remove one by one by full name of the packages}
                { but all packages are installed jointly in a single command }

9_ disable firewall ____________________# lokkit _________________________


SERVER   SIDE                                               

                Dhcp server has 6 packages install              

Dhcp server
            10.0.0.2

Lokkit disable firewall
 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
#setup ________ to give the ip
# Service network restart __ network service         

# lokkit _disable firewall                                                                                                       
Then insert DVD  and mount with the /mnt                            

# mount /dev/cdrom  /mnt____ mount with .

#ls
# cd Server
# ls  dhcp* __ to check  the dhcp packages.

#rpm   -ivh dhcp* - - aid  - - force
   {4} packages for dhcp.
___ to install dhcp packages.

# rpm  -qa  | grep dhcp* to check if all install                  



This is the all main configuration for the dhcp server on the server side or on the client side


Now how to configure the main configuration file for the dhcp server.

That is             vi /etc/dhcpd.conf_________main configuration file for the dhcp server.

        But   __ we have to copy this file from the other place in the /etc directory because this                      this file is not present at there. So we have to copy that from
                # cp  /usr/share/doc/dhcp -3.0.5/dhcpd.conf.sample    /etc/dhcp.conf   _____to                                                                                                                             copy.

 CLIENT SIDE




                In dhcp client 2 packages are by default install

DHCP CLIENT
 
                                                                                                                                                       
     # service network restart

    # lokkit_____________
   #dhclient ______- request from client to