Tuesday, December 10, 2013

How to set the fully qualified domain name FQDN in ubuntu server 12.04

                                                                    step 1


                    sudo nano /etc/hosts  

                                                                     step 2

                       127.0.1.1    qbic.example.com    qbic       


                                                                   step 3

                     sudo service apache2 restart

                                                                   step 4

                     
                     hostname --fqdn          or           hostname -f  


                                                                              step 5

                     results       
                       
                                               

How to install rkhunter and check for rootkit on ( web server or local host )

                                                                             step 1
                    sudo apt-get install rkhunter


                                                                               step 2

                     usual settings  for (your mail server) postfix   is   Internet Site
                                                               


                                                                             step 3
                      depends on your local network or FQDN  (hostname -f) ,cat /etc/hosts
                                (127.0.1.1  yourhostname.example.com  yourhostname)=FQDN


                                                                            step 4

                     sudo rkhunter –-update


                                                                         step 5

                                                                     
                                                                       
                                                                      step 6
                                                                         
                    sudo rkhunter --check            


                                                                     step 7
                                                                       


                                                                           step 8
                                                                               
                     press ENTER to continue                


                                                                         step 9
                                                                           
                    keep pressing Enter to continue    
                                                                           
                                                                      step 10

                                                                         


                                                                        step 11

                     sudo nano/var/log/rkhunter.log                      


                                                                           step 12
                                 
                                                                             
                                                                            step 13

                                                                           


                                                                       step 14

                   suspect file : 1  /usr/bin/unhide.rb              

                                                                       step 15
                                                                       
                     sudo nano /usr/bin/unhide.rb                            
                                                                       
                                                                             step 16

                                                                             

                                                                           
                                                                           step 17

                                                                               
                                                                               

                                nothing wrong with this fail  

                                  Server is OK.
                                                       

                                it took 14 minutes of time


How to install and setup fail2ban + bonus unexpected troubleshooting (on server or host)

                                                                  step1
                                                                 

                     sudo apt-get install fail2ban                          
                                                                             
                                                                         
                                                                      step2

                     sudo cp/etc/fail2ban/jail.conf   /etc/fail2ban/jail.conf.back
                                       
                                                                       step3
                                                                               
                     sudo nano  /etc/fail2ban/jail.conf      


                                                                       step4

                     change bantime to any number of  seconds you like

                                                                         
                                                                       step5
                                                                           
                     change maxretry to any numbers you wish        


                                                                         step6

                     change false  to true  to enable protection                 
                                                                             


                                                                      step7

                    change max retry to any number  you wish  


                                                                     step8

                    don't forget to enable vsftpd (if you do sftp or ftp file transfer)


                                                             step9

                       now you need to restart fail2ban  command is 
                       /etc/init.d/fail2ban restart            
                      if it's works for you just fine  if don't works  follow me                         
                                   
 ------------------- As I promised    troubleshoot   or  (dance with a tambourine)    ---------------------

                                                                        step10


                                                                       step 11
                                                                           
                    sudo service fail2ban start                             
                    sudo fail2ban-client status
                      results: now we see only default settings working   (bad) 
                                                               
                                                                     step 12
                      cd /      now you need change to fail2ban directory and remove file fail2ban.sock
                                                                             
                                                                   

                                                                           step 13
                                                                               
                       cd /var/run/fail2ban/                                
                                                                               
                                                                   step 14
                                        before removing a file make copy of fail2ban.sock

  sudo cp /var/run/fail2ban/fail2ban.sock /home/abel/fail2ban.sock.back

                                                                      step 15
                     sudo rm -rf fail2ban.sock
                                                     
                                                                           step 16
                     /etc/init.d/fail2ban restart
                                                    
                                                                               step 17

                    sudo fail2ban-client status  Now you see all the service are enabled (good)
                                                                               

Monday, December 9, 2013

How to disable SSH root login

                                                                         step 1

                      su -                                          
                                                                       
                                                                             step 2
                                                                             
                      nano /etc/ssh/sshd_config


                                                                            step 3

                     Find the line and change  PermitRootLogin YES to NO


                                                                 step 4

                      then press Ctrl+x  and Y                                      
   
                                                                 The end  
                                                   

Wednesday, December 4, 2013

How to change hostname in ubuntu or debian


step 1

nano /etc/hostname


step 2

change in the name that you like
(old name)




step 3
(new name)


step 4
nano /etc/hosts

step 5

(old name)

step 6
(new name)

sudo service hostname restart

                                                  sudo  /etc/init.d/hostname restart

   sudo service networking restart

wordpress problem with plugin updates

                                                           changing permissions will solve the problem                                    ...