Friday, August 28, 2015

Install Opera 12.11 (Browser) in Linux

Install Opera 12.11 (Browser) in Linux

Opera Web Browser is one of the most popular and fastest loading browser developed by Opera Software. The latest stable version is 12.11 was released on June 2012.

         Unfortunately, Opera doesn’t offer repositories to download and keep up-to-date the webbrowser application. So, we need to manually download packages of our need from Opera’s download page and install it from command line


Step 1: Downloading Opera 12.11 Browser

Go to download page of Opera Web Browser 12.11 and choose your distribution to download it.





Step 2: Installing Opera 12.11 Browser

Need to be a Super User (root) to install Opera Web Browser from Command prompt using below command.
# rpm -Uvh opera-12.11-1661.i386.rpm
Installing Opera 12.11 Browser

Step 3: Starting Opera 12.11 Browser

Start Opera Browser from command line and click on Agree.
# opera
Staring Opera 12.11 Browser

Step 4: Browsing Opera 12.11 Browser



Start enjoying the new cool features of browser and keep exploring it.



Thank You.





How to Stop and Disable Unwanted Services from Linux

How to Stop and Disable Unwanted Services from Linux System



When building a server we need to ask ourselves what we actually need from the box. Do I need a Web Server or a FTP Server, a NFS Server or a DNS Server, a Database Server or something else.
Here in this article, we will be discussing some of these unwanted applications and services which you might not needed but they are installed by default during OS installation and unknowingly start eating your system resources.
Lets first know what kind of services are running on the system using the following commands.
[avishek@tecmint]# ps ax
Sample Output
  PID TTY      STAT   TIME COMMAND
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00  \_ [migration/0]
    4 ?        S      0:09  \_ [ksoftirqd/0]
    5 ?        S      0:00  \_ [migration/0]
    6 ?        S      0:24  \_ [watchdog/0]
    7 ?        S      2:20  \_ [events/0]
    8 ?        S      0:00  \_ [cgroup]
    9 ?        S      0:00  \_ [khelper]
   10 ?        S      0:00  \_ [netns]
   11 ?        S      0:00  \_ [async/mgr]
   12 ?        S      0:00  \_ [pm]
   13 ?        S      0:16  \_ [sync_supers]
   14 ?        S      0:15  \_ [bdi-default]
   15 ?        S      0:00  \_ [kintegrityd/0]
   16 ?        S      0:49  \_ [kblockd/0]
   17 ?        S      0:00  \_ [kacpid]
   18 ?        S      0:00  \_ [kacpi_notify]
   19 ?        S      0:00  \_ [kacpi_hotplug]
   20 ?        S      0:00  \_ [ata_aux]
   21 ?        S     58:46  \_ [ata_sff/0]
   22 ?        S      0:00  \_ [ksuspend_usbd]
   23 ?        S      0:00  \_ [khubd]
   24 ?        S      0:00  \_ [kseriod]
   .....
Now, let’s have a quick look at the processes accepting connection (ports) using the netstat command as shown below.
[avishek@tecmint]# netstat -lp
Sample Output
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 *:31138                     *:*                         LISTEN      1485/rpc.statd      
tcp        0      0 *:mysql                     *:*                         LISTEN      1882/mysqld         
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:ndmp                      *:*                         LISTEN      2375/perl           
tcp        0      0 *:webcache                  *:*                         LISTEN      2312/monitorix-http 
tcp        0      0 *:ftp                       *:*                         LISTEN      2174/vsftpd         
tcp        0      0 *:ssh                       *:*                         LISTEN      1623/sshd           
tcp        0      0 localhost:ipp               *:*                         LISTEN      1511/cupsd          
tcp        0      0 localhost:smtp              *:*                         LISTEN      2189/sendmail       
tcp        0      0 *:cbt                       *:*                         LISTEN      2243/java           
tcp        0      0 *:websm                     *:*                         LISTEN      2243/java           
tcp        0      0 *:nrpe                      *:*                         LISTEN      1631/xinetd         
tcp        0      0 *:xmltec-xmlmail            *:*                         LISTEN      2243/java           
tcp        0      0 *:xmpp-client               *:*                         LISTEN      2243/java           
tcp        0      0 *:hpvirtgrp                 *:*                         LISTEN      2243/java           
tcp        0      0 *:5229                      *:*                         LISTEN      2243/java           
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:http                      *:*                         LISTEN      6439/httpd          
tcp        0      0 *:oracleas-https            *:*                         LISTEN      2243/java         
....
In the above output, you notice that some of the applications you may not needed on your server but they are still running as follows:

1. smbd and nmbd

smbd and nmbd are daemon of Samba Process. Do you really need to export smb share on windows or other machine. If not! why are these processes running? You can safely kill these processes and disable them from starting automatically when machine boots the next time.

2. Telnet

Do You need bidirectional interactive text-oriented communication over internet or local area network? If not! kill this process and turn-off it from starting at booting.

3. rlogin

Do you need to log in to another host over network. If not! Kill this process and disable it from starting automatically at boot.


4. rexec

The Remote Process Execution aka rexec lets you execute shell commands on a remote computer. If you don’t require to execute shell command on a remote machine, simply kill the process.


5. FTP

Do you need to transfer files from one host to another host over Internet? If not you can safely stop the service.


6. automount

Do you need to mount different file systems automatically to bring up network file system? If not! Why is this process running? Why are you letting this application to use you resource? Kill the process and disable it from starting automatically.


7. named

Do you need to run NameServer (DNS)? If not what on earth is compelling you to run this process and allow eating up your resources. Kill the running process first and then turn-off it from running it at boot.


8. lpd

lpd is the printer daemon which makes it possible to print to that server. If you don’t need to print from the server chances are your system resources are being eaten up.


9. Inetd

Are you running any inetd services? If you are running stand alone application like ssh which uses other stand alone application like Mysql, Apache, etc. then you don’t need inetd. better kill the process and disable it starting next time automatically.


10. portmap

Portmap which is an Open Network Computing Remote Procedure Call (ONC RPC) and usages daemon rpc.portmap and rpcbind. If these Processes are running, means you are running NFS server. If NFS server is running unnoticed means your system resources are being used up un-necessarily.


How to Kill a Process in Linux

In order to kill a running process in Linux, use the ‘Kill PID‘ command. But, before running Kill command, we must know the PID of the process. For example, here I want to find a PID of ‘cupsd‘ process.
[avishek@tecmint]# ps ax | grep cupsd
 
1511 ?        Ss     0:00 cupsd -C /etc/cups/cupsd.conf
So, the PID of ‘cupsd‘ process is ‘1511‘. To kill that PID, run the following command.
[avishek@tecmint]# kill -9 1511

How to Disable a Services in Linux


In Red Hat based distributions such as Fedora and CentOS, make use of a script called ‘chkconfig‘ to enable and disable the running services in Linux.
For example, lets disable the Apache web server at the system startup.
[avishek@tecmint]# chkconfig httpd off
[avishek@tecmint]# chkconfig httpd --del
In Debian based distributions such as Ubuntu, Linux Mint and other Debian based distributions use a script called update-rc.d.
For example, to disable the Apache service at the system startup execute the following command. Here ‘-f’ option stands for force is mandatory.
[avishek@tecmint]# update-rc.d -f apache2 remove

After making these changes, The system next time will boot without these UN-necessary process which in-fact will be saving our system resource and the server would be more practical, fast, safe and secure.


Thank You






Protect SSH Logins with SSH & MOTD Banner Messages

Protect SSH Logins with SSH & MOTD Banner Messages

One of the easiest way to protect and secure SSH logins by displaying warming message to UN-authorized users or display welcome or informational messages to authorized users.

        Being a system administrator whenever configure Linux servers I always use to configure a security banners for ssh logins. The banner contains some security warning information or general information. See my example banner message which I used for my all servers.
ALERT! You are entering into a secured area! Your IP, Login Time, Username has been noted and has been sent to the server administrator!
This service is restricted to authorized users only. All activities on this system are logged.
Unauthorized access will be fully investigated and reported to the appropriate law enforcement agencies.
     There are two way to display messages one is using issue.net file and second one is using MOTD file.
o                    issue.net : Display a banner message before the password login prompt.
o                    motd : Display a banner message after the user has logged in.
So, I strongly recommended all system administrator to display a banner messages before allowing users to log in to systems. Just follow below simple steps to enable SSH logging messages.

Display SSH Warning Message to Users Before Login

To display Welcome or Warning message for SSH users before login. We use issue.net file to display a banner massages. Open the following file with VI editor.
# vi /etc/issue.net
Add the following banner sample message and save the file. You can add any custom banner message to this file.
###############################################################
#                                                      Welcome to Linux Help by NITIN                                                          # 
#                                   All connections are monitored and recorded                                         #
#                          Disconnect IMMEDIATELY if you are not an authorized user!                    #
###############################################################
Open the master ssh configuration file and enable banners.
# vi /etc/ssh/sshd_config
Search for the word “Banner” and uncomment out the line and save the file.
#Banner /some/path
It should be like this.
Banner /etc/issue.net (you can use any path you want)
Next, restart the SSH daemon to reflect new changes.
# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
Now try to connect to server you will see banner message similar to below.

SSH Banner Messages Before Login


Display SSH Warning Message to Users After Login

To display banner messages after login, we use motd file, which is used to display banner massages after login. Now open it with VI editor.
vi /etc/motd
Place the following banner sample message and save the file.
###############################################################
#                                                   Welcome to  Linux Help by NITIN                                                     # 
#                                    All connections are monitored and recorded                                       #
#                           Disconnect IMMEDIATELY if you are not an authorized user!                  #
###############################################################
Now again try to login into server you will get both the banner messages. See the screen-shot attached below.
Display SSH Banner After Login





Thank You

Install Linux Malware Detect (LMD)

Install Linux Malware Detect (LMD) in RHEL,CentOS and Fedora


Step 1: Downloading Linux Malware Detect (LMD)

Downloading latest LMD package using following wget command.
# cd /tmp
# wget http://www.rfxn.com/downloads/maldetect-current.tar.gz

Step 2: Installing LMD

Installation and Configuration of LMD is a bit easy task, just follow below steps as root user.
# tar xfz maldetect-current.tar.gz
# cd maldetect-*
# ./install.sh

Sample Output

Linux Malware Detect v1.4.1
            (C) 2002-2011, R-fx Networks 
            (C) 2011, Ryan MacDonald 
inotifywait (C) 2007, Rohan McGovern 
This program may be freely redistributed under the terms of the GNU GPL
 
installation completed to /usr/local/maldetect
config file: /usr/local/maldetect/conf.maldet
exec file: /usr/local/maldetect/maldet
exec link: /usr/local/sbin/maldet
exec link: /usr/local/sbin/lmd
cron.daily: /etc/cron.daily/maldet
 
maldet(3092): {sigup} performing signature update check...
maldet(3092): {sigup} local signature set is version 201205035915
maldet(3092): {sigup} new signature set (2012071115632) available
maldet(3092): {sigup} downloaded http://www.rfxn.com/downloads/md5.dat
maldet(3092): {sigup} downloaded http://www.rfxn.com/downloads/hex.dat
maldet(3092): {sigup} downloaded http://www.rfxn.com/downloads/rfxn.ndb
maldet(3092): {sigup} downloaded http://www.rfxn.com/downloads/rfxn.hdb
maldet(3092): {sigup} downloaded http://www.rfxn.com/downloads/maldet-clean.tgz
maldet(3092): {sigup} signature set update completed
maldet(3092): {sigup} 9649 signatures (7782 MD5 / 1867 HEX)

Step 3: Configuring LMD

By default all options are fully commented in the configuration file, so configure it according to your needs. But before making any changes let’s have a detailed review of each option below.
o                    email_alert : If you would like to receive email alerts, then it should be set to 1.
o                    email_subj : Set your email subject here.
o                    email_addr : Add your email address to receive malware alerts.
o                    quar_hits : The default quarantine action for malware hits, it should be set 1.
o                    quar_clean : Cleaing detected malware injections, must set to 1.
o                    quar_susp : The default suspend action for users wih hits, set it as per your requirements.
o                    quar_susp_minuid : Minimum userid that can be suspended.
Open file /usr/local/maldetect/conf.maldet and make changes according to your needs.
# vi /usr/local/maldetect/conf.maldet

Sample Configuration

Here is the my sample configuration file.
# [ EMAIL ALERTS ]
##
# The default email alert toggle
# [0 = disabled, 1 = enabled]
email_alert=1
 
# The subject line for email alerts
email_subj="maldet alert from $(hostname)"
 
# The destination addresses for email alerts
# [ values are comma (,) spaced ]
email_addr="tecmint.com@gmail.com"
 
# Ignore e-mail alerts for reports in which all hits have been cleaned.
# This is ideal on very busy servers where cleaned hits can drown out
# other more actionable reports.
email_ignore_clean=0
 
##
# [ QUARANTINE OPTIONS ]
##
# The default quarantine action for malware hits
# [0 = alert only, 1 = move to quarantine & alert]
quar_hits=1
 
# Try to clean string based malware injections
# [NOTE: quar_hits=1 required]
# [0 = disabled, 1 = clean]
quar_clean=1
 
# The default suspend action for users wih hits
# Cpanel suspend or set shell /bin/false on non-Cpanel
# [NOTE: quar_hits=1 required]
# [0 = disabled, 1 = suspend account]
quar_susp=0
# minimum userid that can be suspended
quar_susp_minuid=500


Step 4: Manual Scans and Usage

If you would like to scan user’s Home directory, then simply issue following command.
# maldet --scan-all /home
You performed a scan but failed to turn on the quarantine option, don’t worry just use the following command to turn on and quarantine all previous malware scan results.
# maldet --quarantine SCANID
OR
# maldet --clean SCANID

Step 5: Daily Scans

By default installation keeps LMD script under /etc/cron.daily/maldet and it is used to perform a daily scans, update of signatures, quarantine etc, and sends a daily report of malware scan to your specified emails. If you need to add additional paths to be scanned, then you should edit this file accordingly to your requirements.

# vi /etc/cron.daily/maldet

Thank You