openSSH stands for Secure Shell is an evergreen tool to connect remote Linux server securely. Security is one of the major task for Linux administrator that to two types, application & server level security.

We have written many articles about ssh and its security, today also we are going to discuss about ssh security with help of ssh_scan application. By default ssh configuration enable vast of security options which already provide good security but still you can secure more option based on your environment and requirement.

Suggested Read : How to Access Secure Shell (SSH) Servers Through Standard Web Browsers

What’s ssh_scan ?

ssh_scan is a prototype SSH configuration and policy scanner for Linux and UNIX servers, which will scan destination host and tells you list of configured options. Also recommends possible policy, Algorithms and configuration parameters such as KexAlgorithms, Ciphers, MACs & sandbox, etc.,

Suggested Read : PSSH – Execute Commands on Multiple Linux Servers in Parallel

ssh_scan is a free and opensource application inspired by Mozilla openssh security guidelines.

Suggested Read : rtop – A Nifty Tool to Monitor Remote Server Over SSH

Additional key benefits for ssh_scan

It Uses native Ruby and BinData to scan the system and requires very minimal dependencies.

It’s not just a script and portable application which can be used in another project or for automation of tasks.

Simple point ssh_scan at an SSH service and get a JSON report of what it supports and its policy status.

Highly configurable so we can custom our own policies that fit our unique policy requirements.

Suggested Read : Mosh (Mobile Shell) – Best Alternative for SSH to Connect Remote System

How to install ssh_scan in Linux ?

There is no official distribution package for ssh_scan but we can easily install ssh_scan on Linux through gem as well as source package.

To install and run as a gem, type:

For Debian/Ubuntu :

$ sudo apt-get install ruby gem $ sudo gem install ssh_scan

For CentOS/RHEL :

$ sudo yum install ruby gem $ sudo gem install ssh_scan

For Fedora :

$ sudo dnf install ruby gem $ sudo gem install ssh_scan

For Arch Linux :

$ sudo pacman -S ruby gem $ sudo gem install ssh_scan

For openSUSE :

$ sudo zypper install ruby gem $ sudo gem install ssh_scan

To run from a docker container, type:

# docker pull mozilla/ssh_scan # docker run -it mozilla/ssh_scan /app/bin/ssh_scan -t github.com

To install and run from source, type:

# git clone https://github.com/mozilla/ssh_scan.git && cd ssh_scan # gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 # curl -sSL https://get.rvm.io | bash -s stable # rvm install 2.3.1 # rvm use 2.3.1 # gem install bundler # bundle install # ./bin/ssh_scan

How to use ssh_scan ?

There is no difficulty to use ssh_scan since it uses simple syntax.

common syntax for ssh_scan

$ ssh_scan -t IP or IP Range $ ssh_scan -t Hostname $ ssh_scan -f hosts.txt $ ssh_scan -t IP -p 2200

To scan SSH configuration and policy of server 192.168.1.100.

Additionally you can pass more than one IP in single shot.

$ ssh_scan -t 192.168.1.100,101,102

Also you can pass host name instead of IP address.

$ ssh_scan -t server.2daygeek.com

To get input from file.

$ ssh_scan -f hosts.txt

To scan non standard port ssh server.

$ ssh_scan -t 192.168.1.100 -p 2200

To view more options about ssh_scan.

$ ssh_scan -h