Skip to main content

useful ubuntu/debian commands for sys-Admin

  • To clean the cache from system which apt caches when we update/install the packages
apt-get clean 
    •   To downloads  packages list from repository and update them,to get data on latest available packages
    apt-get update 
      •  To install specific version of  package
      apt-get install package-name 
      • To check OS version   
      Ex : lsb_release -a
        • To provides the package's description, its dependencies, the name of its maintainer. apt search, apt show, aptitude search, aptitude show work in the similar manner
        Ex : apt-cache search php5-fpm
          • The checkrestart program tries to determine if there are  processes  in the  system  that  need to be restarted after a system upgrade .Consequently, checkrestart is sometimes used as an audit tool  to  find outdated  versions  of  libraries  in  use, particularly after security upgrades

          Ex : checkrestart -h
            •  List all installed packages, along with package version and short details.
            Ex : dpkg -l php5-fpm
            • To check OS version 
            Ex : lsb_release -a
              • To check memcache version on debian
              Ex : telnet localhost 11211;and type 'version'

                • To check openssl version on debian
                Ex : openssl version -a OR dpkg-query -l | grep openssl

                  • To know the date on which current version of OpenSSL was built
                  Ex : openssl version -a OR dpkg-query -l | grep openssl

                    • To check auto update is enable
                    Ex : apt-get install unattended-upgrades and look into the files /etc/apt/apt.conf.d/10periodic /etc/apt/apt.conf.d/20auto-upgrades
                    • To check available packages in Debian/ubuntu
                    Ex : apt-cache policy openssl
                      • To check Loaded configuration files in Ubuntu
                      Ex : php --ini OR php -i | grep 'php.ini'
                        • To get glibc version
                        Ex : ldd --version
                          • To start a daemon at startup
                          Ex : update-rc.d service_name defaults
                            • To remove a daemon at startup
                            Ex : aupdate-rc.d -f service_name remove
                              • To check apache using which module perfork or worker 
                              Ex : apache2ctl -l OR apache2ctl -M
                                • To add CD-rom as repository
                                Ex : openssl version -a OR dpkg-query -l | grep openssl

                                  Comments

                                  Popular posts from this blog

                                  Solution and Step to fix CVE-2019-5736 Vulnerability - Docker

                                  Recently a new vulnerability has been discovered in the the internet market having target to Docker services. What is this Vulnerability: In short, Docker service uses another service called as runc which is container run time to spawn and run containers. which simply means if docker task is to create docker images then runc task would be running them and attaching a process to container. So as per the recent discovery by the maintainers of runc, the code of this service was having some bug which can be used by attackers to gain the root level of access of the host machine on which docker containers are running. How it can be Exploited: This vulnerability can be exploited in two ways (1) if the docker images are in use is vulnerable making the containers build from it vulnerable also (2) if somehow attacker got the access of containers and then trying to exploit using the bug present in runc and trying to get root privileges. Solution to Fix Vulnerability: Ce

                                  How to Generate CSR using Openssl in Linux

                                  Before Generating CSR ,let see what is Openssl. It is nothing but a core library ,which is used for general purpose in cryptography,it is an open source product which work towards the implementation of SSL and TLS protocols. Talking about openssl, some people called the certificates generated from openssl as "self signed certificate". lets go towards now,creating CSR and private key using openssl command, Just log in to any of your Linux box and run following command as  root user  replacing the required information as per your need . [root@SVR home]#   openssl req -new -newkey  rsa:2048 -nodes -sha256 -out domain_name.csr -keyout domain_name.key -subj "/C=US/ST=state/L=locality/O=organization/OU=organization unit Dept/CN=www.domain.com"  You will get output like : Then check whether ,all the information we have entered ,while creating CSR is proper ,by decoding the CSR from some online tool. First do the cat to the csr file [root@SVR home]#  cat

                                  Multiple instances of redis

                                  In the last post I have covered how to install redis server on Centos/Rhel using rpm method and yum method and some troubleshooting skills. In this post i am going to cover how to install and configure redis to run with multiple ports.                                                                           But why we need more ports ? If you have read my earlier post , you already know that by default redis runs on single port 6379, which any one can use it for small website to cache the data. But for heavy website like magento we need to use additional ports along with 6379 to serve different cache from different ports. Like in Magento there is simple cache which is normally stored under /var/cache directory. Then there is Full Page Cache which is stored under /var/full_page_cache and session cache which is stored under /var/session_cache. Note : Discussion about cache/full page cache/session is not under the scope for this document.