Tuesday, December 10, 2013

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

Saturday, November 30, 2013

How to distribution upgrade your ubuntu server from terminal

                                                                  step 1
                    sudo  apt-get dist-upgrade  
                                           
     

How to make keyboard shortcut for Gnome terminal in debian

step 1


                                                               
                                                                step 2



                                                                step 3



                                                             step 4

 

                                                        step 5

                                  name your command Terminal
                                  and type gnome-terminal --tab 
                                             
                                                             step 6

                                  then  Apply

                                                              step 7

                                 click on Disabled


                                                               step 8
                                  now press Ctrl + t
                                 (but you can choose any combination keys you want)
                                                         
                                                          step 9
                                               

Monday, November 25, 2013

How to Add correct host key in /root/.ssh/known_hosts to get rid of this message.

                                                            step 1
                                                                 
                                                             


                                                             step 2

                          command    ssh-keygen -R 192.168.1.22
                          ( you have to use ip address of remote host )                              
                             

                                                               step 3
                          and same time after boot you don't see greeting
                          to fix this type   landscape-sysinfo
                                                         

Wednesday, November 20, 2013

How to use SFTP securely Download and Upload Files to remote host or server

                                                                                                                                  step 1
                                                               
                                                                                                     sftp abel@192.168.1.21  hit Enter 
                                                               (sftp host or server name@ipaddress)                 
                                                 
                                                                                                                                    step 2
                                                                                                                       you are in
                                                       
                                                                                                                                    step 3
                                                                                                                               ls                              

                                                                                                                                    step 4
                                                               
                                                                                                                             cd to your directory                    
                                                                                                                                      step5
                                                                     

                                                                                                                                      step 6

                                                                                                     command  get filenameyouwanttotransfer  Enter                            
                                                             
                                                                                                                                    step 7
                                                                   

                                                                     
                                                                                                                                   step8
                                                                     

                                                                   
                                                                                                                                    step 9
                                                               

                                                         
                                                                                                                                      step 10
                                                                 
                                                             
                                                                                                                                           step 11

                                                                                                                                         

                                                                                                                  on my local host 192.168.1.2                  
                                                           
                                                                                                                                step 12

                                                                                                                         if permission is denied
                                                                                                     you have to change permission on remote server or pc      
                                                       

                                                                                                                                            step 12
                                                                 
                                                                                                              sudo chmod 777 Documents  
                                                                                                      (then if you wish you can change back to 755) 
                                                                                                             (remote server 192.168.1.21)
                                                             
                                                                                                                                              step 13
                                                                                                               Now no errors. REMEMBER >>you uploading a file to the
                                                                                                               directory where you are , in my case /home/abel/Documents

                                                                                                                command  put  copyandpastefrom Enter
                                                                                                               (your local host 192.168.1.2)
                                                       
                                                                                                                                               step 14
                                                               
                                                                             file uploaded to server                      
                                                             

                                                                                               the end.

wordpress problem with plugin updates

                                                           changing permissions will solve the problem                                    ...