Skip to main content

Posts

Showing posts with the label SSH

How To Install DenyHosts on Linux

About DenyHosts DenyHosts is a security tool written in python that monitors server access logs to prevent brute force attacks on a linux server. The program works by banning IP addresses that exceed a certain number of failed login attempts.   Step One—Install Deny Hosts DenyHosts is very easy to install on Ubuntu #  apt-get install denyhosts On RHEL/Centos: We need   epel repo   to install fail2ban on RHEL/Centos based machines. So, download the rpm:- # wget   http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm and, then install # yum install denyhosts Once the program has finished downloading, denyhosts is installed and configured on your linux server.   Step Two—Whitelist IP Addresses After you install DenyHosts, make sure to whitelist your own IP address. Skipping this step will put you at risk of locking yourself out of your own machine.   Open up the list of allowed hosts al...

Securing your OpenSSH server in Linux

Secure Shell (SSH) is a program used to secure communication between two entities, often used as a replacement for Telnet and the Berkeley protocols such as remote shell (RSH) and remote login (Rlogin). SSH is also used as a secure remote copy utility, replacing traditional protocols such as the File Transfer Protocol (FTP) and Remote Copy Protocol (RCP). For this tutorial, we are going to demonstrate steps on securing your   OpenSSH Server  which is a free version of the SSH protocol suite. Note: Steps 1-9 can be done by  tweaking your sshd_config and do ssh service restart after changes to take effect. 1.   Use SSH Protocol 2 Use SSH version 2 (SSH2) only as it offers more performance, flexibility and security than SSH1. -To verify what SSH protocol version you are running, check your /etc/ssh/sshd_config and look for the line “Protocol”, [root@linuxtechtips ~]# vi /etc/ssh/sshd_config Protocol 2 [root@linuxtechtips ~]# /etc/init.d/sshd...

Passwordless SSH logins

There are a few cases where having passwordless access to a machine is quite convenient or necessary. I'm looking up for commands that I can just copy and paste to do it right quick. Below are the steps:- 1. Generate key pair:-        One of the login modes of SSH is to use a SSH key based authentication. A key pair is made up of both a private and a public key. The private key is kept on your local machine very securely while your public key is what you distribute to all the machines you want to log in to. There are a few flavors of keys you can generate, rsa1 (for SSH1), dsa (SSH2), or rsa (SSH2). Most linux admins like DSA. You can (and should) associate a password with your key pair, so that only you can use it even if someone else manages to gain access to your account. Password for key is not recommened when you want to use it for daily tasks or tasks that are done through cron jobs. If you have more than one key pair, using the same password for a...