Friday, September 6, 2013

BASH FILES CONFIGURATION MODIFICATION AND MANAGEMENT OF BASH FILES BY GORVAM SADDAR



TROUBLESHOOTING THE [.BASH] FIILES

.BASH files are the main login or logout files of the Linux. .BASH are [4] files that works after login and          
              And after logout.
            1__these  files contain the information  about the ROOT, MACHINE NAME AND SIMLE USER.
            2__.BASH files are Hidden files starting with [.].
            3__ to see run command
                        #ls –al
            4__ there are four .bash files that re as.                               Works of the files

These two files are used after login and during the system login
 
                        1_ .bash_profile
                        2_ .bashrc

This file contain the history of commands that we use recently
 
                        3_ .bash_history

This file use when we logout the user
 
                        4_ .bash_logout          
 


                        These four have there own different works depending on them.
                        If we MODIFY any file it could be create a problem for the system.

Now how-to do troubleshooting ___________________________________________________

            Case 1________ if files are deleted then
                                   
            [ the backup of  [.bash] files is in the [/etc/skel/.bash*] ]

            Like someone delete the files

                        #rm –rf .bash*
                        #logout

            Then after logout when you login you see the following screen with bash error

                        Login : root
                        Passwd:
                        -bash-3.1# _____________________this is the change only because the files that contain the
                                                                                    Information of this place are missing.
                                                                                    We can  use our system normally except we don’t know                                                                                           which the terminal is. 


Now copy files from the backup to the root

                        # cp /etc/skel/.bash* /root/ _________-enter
                                                           
                                    All files now copy and logout then login the system you get the normal position.

                        # logout
                       
                        Login : root
                        Passwd:
                       
                        [root@localhost~]#
The problem is solved of deleting of the files
                                                                                    But someone can also modify the files also in backup files.

            If someone MODIFY the files _____________________


            Like write [logout] at the end of the file and save then after you logout you cant login till the logout not             deleted.

            # vi .bash_profile _____________________________ open file
            Khsdkfaidfgaksdnfkans,df
            J;skgjfo;skagsoljagk;j’lkfl fkjpoksdfpikpsdokfp’sdk, ‘l;fgsklopsd pkpskfs
            Loksjgvljdflg





            Lpodkjgpjdfgdsfg;jmdgf
            There is some text like that in the file.
           


            Logout ______________________________________________________if you write logout here



            :wq


  Now you can`t login till you go to run level 1 to troubleshoot the file mean to delete the logout from the file.

            OPEN RUN LEVEL 1 THEN DELETE LOGOUT FROM THE FILE.
            THIS ALSO HAPPEN IN THE .bashrc FILE SAME PROCEDURE TO RECOVER

                        RUN LEVEL

            

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.